Maptips Class
Maptips class.
The map tip module provides functions to create a small popup window as the mouse hovers over a feature on the map (point, polygon, line, etc.). NOTE: This module uses global config object. featureLayers->mapTipSettings
Item Index
Methods
Properties
Methods
checkMaptipPosition
-
target
-
graphic
Checks if the maptip is hidden by the sub-panel and publishes a center-at event to pan the map, moving maptip into view.
Parameters:
-
target
JObjecta node to which the tooltip will be attached
-
graphic
Object[description]
getLayerConfigWithId
-
id
Returns the feature layer config for the given id
Parameters:
-
id
Stringlayer id string
getMaptipContent
-
graphic
-
interactive
Generates content for a maptip.
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.
getSubPanelLeftOffset
()
Number
private
Returns the position of the sub-panel relative to the leftmost edge of the screen.
Returns:
position of hte sub-panel relative to the leftmost edge of the screen
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
getToolTipOffset
()
Number
private
Returns the position of the maptip relative to the leftmost edge of the screen.
Returns:
the position of the maptip relative to the leftmost edge of the screen
init
()
Calls the event handling initialization function
initListeners
()
private
Initialize event listeners for the maptip events
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
Events
Maptips.EXTENT_CHANGE [subscribed]
Maptips.REPOSITION_INTERACTIVE [subscribed]
Repositions the interactive tooltip that is already displayed when the user pans or zooms the map, or the map is otherwise adjusted. If the tooltip is hidden from the view by the SubPanel or the edge of the map container, it is hidden from the page.
Event Payload:
-
offset
NumberNew tooltip offset relative to the shape it's attached too; when zooming, the shape changes its size and the offset needs to be recalculated to keep the tooltip in relative center
Maptips.SHOW [subscribed]
Displays a simple, temporary maptip, positioning it over the target
jObject; the content of the maptip is build from the
contents of the graphic
object and the mapTip template specified in the config object.
Event Payload:
-
target
JObjecta node/svg object the user hovered over
-
graphic
ObjectESRI graphic object belonging to the target
Maptips.SHOW_INTERACTIVE [subscribed]
Displays an permanent, interactive maptip with a close button, positioning it over the target
jObject; the content of the maptip is build from the
contents of the graphic
object and the mapTip template specified in the config object.
The maptip will not be shown if it's covered by the open SubPanel.
Event Payload:
-
target
JObjecta node/svg object the user hovered over
-
graphic
ObjectESRI graphic object belonging to the target