TmplHelper Class
A set of functions used to support and standardize the use of templating
Item Index
Methods
Properties
Methods
_getSymbolConfig
-
layerUrl
-
wmsName
Gets the defined symbology from a layer's web service
Parameters:
Returns:
The defined symbology from the layer definition
getFeatureName
-
graphic
-
layerConfig
Given a feature object or a graphic object (or any object that has a getLayer method and an attributes field) return the attribute value for its designed "name" field
NOTE: all dependent functions should be written as nested functions inside the caller function, otherwise TmplEx templating library won't identify
Parameters:
-
graphic
Graphic -
layerConfig
Object
Returns:
imageUrl Url to the features symbology image
getGraphicIcon
-
graphic
-
layerConfig
Given a feature object or a graphic object (or any object that has a getLayer method and an attributes field) return the image URL for that feature/graphic object.
NOTE: all dependent functions should be written as nested functions inside the caller function, otherwise TmplEx templating library won't identify
Parameters:
-
graphic
Graphic -
layerConfig
Object
Returns:
imageUrl Url to the features symbology image
getLayerConfig
-
url
-
wmsName
Returns the feature layer config for the given url
getObjectId
-
graphic
Given a feature object return the objectid for that item. This will likely fail on a non-feature object (e.g. a plain graphic)
NOTE: all dependent functions should be written as nested functions inside the caller function, otherwise TmplEx templating library won't identify
Parameters:
-
graphic
Graphic
Returns:
objectId
getSymbolForFeature
-
feature
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:
-
feature
Object
Returns:
The default icon used to represent the feature layer
getSymbolForLayer
-
layer
-
wmsName
Gets the default symbology icon from a layer's web service
Parameters:
Returns:
The default icon from the layer's symbology
loadStrings
()
Updates some of the Strings on the HTML page using the config string resources
Properties
getConfigUrl
Object
Returns 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