Reusable Accessible Mapping Platform

API Docs for: 4.0.0
Show:

GraphicExtension Class

GraphicExtension class containing helper functions for graphic objects. Note this class requires the config object.

Methods

_getSymbolConfig

(
  • layerUrl
  • wmsName
)
Esri/layer/symbology

Gets the defined symbology from a layer's web service

Parameters:

  • layerUrl String

    A URL to the feature layer service

  • wmsName String

    WMS Layer name. Optional. Should only be provided if attempting to get a WMS layer.

Returns:

Esri/layer/symbology:

The defined symbology from the layer definition

getGraphicTitle

(
  • graphic
)

Returns the content of the name field of the provided graphic object

Parameters:

  • graphic Esri/Graphic

    a graphic object or a feature object

Returns:

getLayerConfig

(
  • graphic
)
Esri/Graphic

Inherited from RAMP but overwritten in src\js\RAMP\Modules\graphicExtension.js:48

Given a graphic object, returns the config object associated with the graphic's layer.

Parameters:

  • graphic Esri/Graphic

    a graphic object or a feature object

Returns:

Esri/Graphic:

getOid

(
  • graphic
)

Returns the oid of the given graphic object

Parameters:

  • graphic Esri/Graphic

getServiceURL

(
  • rampService
  • mapID
  • language
)

This method builds a complete service URL callout for a map configuration. The URL is built using a base URL and map ID, and a language culture code.

Parameters:

  • rampService String

    The base URL for a web service that provide's valid map JSON configuration data

  • mapID Number

    a unique identifier for a group of map configuration

  • language String

    culture code either 'en' or 'fr'

getSymbolForFeature

(
  • feature
)
Icon

Given a feature object or a graphic object (or any object that has a getLayer method and an attributes field) return the object containing the image URL and legend text for that feature/graphic object.

Parameters:

Returns:

Icon:

The default icon used to represent the feature layer

getTextContent

(
  • graphic
)
Object private

Get popup content for a graphic (i.e. a point) This logic is customized per project

Parameters:

Returns:

Object:

found graphic object

loadStrings

()

Updates some of the Strings on the HTML page using the config string resources

Properties

config

Object

The RAMP application config, it should be treated as read only by all modules other than globalStorage and bootstrapper

configServiceURL

String

Contains a URL that points to the application configuration (JSON format) if it's hosted on a web service. This is not required if the application has a JSON config file in the website's folder

plugins

Object

A registry of plugins for RAMP code to reference, these should be loaded and registered by bootstrapper.js