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
- _getSymbolConfig
- adjustHeight
- adjustHelpDimensions
- adjustWidth
- adjutSubPanelDimensions
- captureSubPanel
- checkMaptipPosition
- dockSubPanel
- getLayerConfig
- getMaptipContent
- getSubPanelLeftOffset
- getSymbolForFeature
- getToolTipOffset
- hideSubPanel
- init
- initListeners
- layoutChange
- load
- loadStrings
- newSubPanel
- showMapTip
- showSubPanel
- subPanelChange
- toggleFooter
- toggleFullScreenMode
- toggleSubPanelContainer
Attributes
Events
- gui.events.FULLSCREEN_CHANGE
- gui.events.HELP_PANEL_CHANGE
- gui.events.LAYOUT_CHANGE
- gui.events.PANEL_CHANGE
- gui.events.PANEL_TOGGLE [subscribed]
- gui.events.SUBPANEL_CAPTURE [subscribed]
- gui.events.SUBPANEL_CHANGE
- gui.events.SUBPANEL_CLOSE [subscribed]
- gui.events.SUBPANEL_DOCK [subscribed]
- gui.events.SUBPANEL_OPEN [subscribed]
- gui.events.TAB_DESELECTED
- gui.events.TAB_SELECTED
- gui.events.TOGGLE_FULLSCREEN [subscribed]
- gui/add-layer-panel-change
- maptips.events.EXTENT_CHANGE [subscribed]
- maptips.events.REPOSITION_INTERACTIVE [subscribed]
- maptips.events.SHOW [subscribed]
- maptips.events.SHOW_INTERACTIVE [subscribed]
Methods
_getSymbolConfig
-
layerUrl
Gets the defined symbology from a layer's web service
Parameters:
-
layerUrl
StringA URL to the feature layer service
Returns:
The defined symbology from the layer definition
adjustHeight
()
private
Adjust the height of the body of the page on initial load and every page resize.
adjustHelpDimensions
()
private
Adjusts dimensions of the help panel relative to the mapContent div
.
adjustWidth
()
private
Adjusts the width of the slide out panel and the map section.
adjutSubPanelDimensions
-
subPanel
Adjusts the dimensions and position of the SubPanel when layout of the page is changing.
Parameters:
-
subPanel
SubPanelSubPanel whose dimensions and position need to be adjusted
captureSubPanel
-
attr
Finds a SubPanel with origin
equal to the supplied consumeOrigin
and
- changes its
origin
to the suppliedorigin
- moves the SubPanel in the DOM hierarchy and attaches it to the specified target
Parameters:
-
attr
SubPanelSettingsSettings for the SubPanel; only
origin
,consumeOrigin
andtarget
are required here
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]
dockSubPanel
-
attr
Moves the SubPanel with the specified origin
in the DOM hierarchy to the new specified target
; if target
is not specified, the SubPanel is attached to the SidePanel.
Parameters:
-
attr
SubPanelSettingsSettings for the SubPanel; only
target
andorigin
are required here
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 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
hideSubPanel
-
attr
-
speed
-
d
Closes the SubPanel whose origin
is specified in the attr
parameter.
Parameters:
-
attr
SubPanelSettingsonly
origin
attribute is required here -
speed
NumberDuration of the closing animation
-
d
DeferredThe deferred object to be resolved upon successful closing of the panel
init
()
Calls the event handling initialization function
initListeners
()
private
Initialize event listeners for the maptip events
layoutChange
()
private
Fires an event when the layout of the page changes.
load
-
id
-
req
-
load
Call load to initialize the GUI module.
loadStrings
()
Updates some of the Strings on the HTML page using the config string resources
newSubPanel
-
attr
Create a new SubPanel with the settings provided.
Parameters:
-
attr
SubPanelSettingsSubPanel settings
Returns:
A newly created SubPanel
showMapTip
-
target
-
graphic
-
interactive
Creates a maptip on the map.
showSubPanel
-
attr
Creates and opens a new SubPanel with given settings.
If the SubPanel with the requested origin
is already present, updates its content.
Parameters:
-
attr
SubPanelSettingsSettings for the SubPanel instance
subPanelChange
-
visible
-
origin
-
container
Fires an even when the subpanel closes or opens.
toggleFullScreenMode
-
fullscreen
Toggles the FullScreen mode of the application
Parameters:
-
fullscreen
Booleantrue/undefined - expand; false - collapse
toggleSubPanelContainer
()
private
Adjust the SubPanels to the full-screen mode of the page.
Attributes
Events
gui.events.FULLSCREEN_CHANGE
Published each time fullscreen is toggled
gui.events.HELP_PANEL_CHANGE
Published each time the help panel opens or closes.
gui.events.LAYOUT_CHANGE
Published each time the layout changes.
gui.events.PANEL_CHANGE
Published each time the panel opens/closes
gui.events.PANEL_TOGGLE [subscribed]
Toggles the main panel (i.e. collapses it if was expanded, and expands it if it was collapsed)
gui.events.SUBPANEL_CAPTURE [subscribed]
Attaches subPanel node to the module that calls it in the DOM hierarchy
Event Payload:
-
consumeOrigin
Object
gui.events.SUBPANEL_CHANGE
Published each time the subpanel opens/closes
gui.events.SUBPANEL_CLOSE [subscribed]
Closes the sub panel
Event Payload:
-
origin
Stringthe name of the module that requested to close the subPanel (e.g. "filterManager")
gui.events.SUBPANEL_DOCK [subscribed]
Moves the panel up DOM hierarchy next to the sidePanel, or to other target
Event Payload:
-
origin
Stringthe name of the module that requested to dock the subPanel (e.g. "filterManager")
-
target
JNodewhere to move the subPanel; if not supplied; sidePanel is used
gui.events.SUBPANEL_OPEN [subscribed]
Opens the subpanel
Event Payload:
-
attr
SubPanelSettingsSettings for the SubPanel
gui.events.TAB_DESELECTED
Fires whenever a tab has been deselected in the main panel
gui.events.TAB_SELECTED
Fires whenever a tab has been selected in the main panel
gui.events.TOGGLE_FULLSCREEN [subscribed]
Toggles the fullscreen
gui/add-layer-panel-change
Published each time the Add Layer panel opens or closes.
maptips.events.EXTENT_CHANGE [subscribed]
maptips.events.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.events.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.events.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