TmplUtil Class
A set of functions that can be accessed within templates
Item Index
Methods
autoHyperlink
-
content
Wraps plain text urls and emails with tags.
Parameters:
-
content
Stringthe text you would like to search in.
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
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
getSymbolForLayer
-
layerConfig
Gets an array of symbology images to display in the layer selector
Parameters:
-
layerConfig
ObjectA layer's config object
Returns:
The array of icon(s) to use in layer selector