undefined

API Docs for: 5.4.2
Show:

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:

EventManager TmplHelper

Uses RAMP Templates:

templates/feature_hovertip_template.json templates/feature_anchortip_template.json

Methods

checkMaptipPosition

(
  • target
  • graphic
)
private

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 JObject

    a node to which the tooltip will be attached

  • graphic Object

    a graphic on the map

getMaptipContent

(
  • graphic
  • interactive
)
private

Generates content for a maptip.

Parameters:

  • graphic Object

    map graphic the tip is describing

  • interactive String

    indicates whether the maptip should have a close button

getSubPanelLeftOffset

() Number private

Returns the position of the sub-panel relative to the leftmost edge of the screen.

Returns:

Number:

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:

Number:

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

showMapTip

(
  • target
  • graphic
  • interactive
)
private

Creates a maptip on the map.

Parameters:

  • target JObject

    a node the user hovered over

  • graphic Object

    the graphic belonging to the target

  • interactive Boolean

    indicates whether the maptip should have a close button

Events

Maptips.EXTENT_CHANGE [subscribed]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:377

Is fired when an interactive maptip is shown and Maptip detects if the maptip is hidden behind the SubPanel and extent change is needed. Sets the scroll payload attribute to true if the extent change is not needed and the Datagrid should scroll to the currently highlighted row.

Event Payload:

  • scroll Boolean

    indicates if the Datagrid should scroll to the currently highlighted row

Maptips.REPOSITION_INTERACTIVE [subscribed]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:387

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 Number

    New 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]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:355

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 JObject

    a node/svg object the user hovered over

  • graphic Object

    ESRI graphic object belonging to the target

Maptips.SHOW_INTERACTIVE [subscribed]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:366

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 JObject

    a node/svg object the user hovered over

  • graphic Object

    ESRI graphic object belonging to the target