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
Imports RAMP Modules:
Uses RAMP Templates:
templates/feature_hovertip_template.json templates/feature_anchortip_template.json
Item Index
Methods
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
Objecta graphic on the map
getMaptipContent
-
graphic
-
interactive
Generates content for a maptip.
getSubPanelLeftOffset
()
Number
private
Returns the position of the sub-panel relative to the leftmost edge of the screen.
Returns:
position of the sub-panel relative to the leftmost edge of the screen
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
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