Reusable Accessible Mapping Platform

API Docs for: 2.0.0
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

Methods

_getSymbolConfig

(
  • layerUrl
  • wmsName
)
Esri/layer/symbology

Gets the defined symbology from a layer's web service

Parameters:

  • layerUrl String

    A URL to the feature layer service

  • wmsName String

    WMS Layer name. Optional. Should only be provided if attempting to get a WMS layer.

Returns:

Esri/layer/symbology:

The defined symbology from the layer definition

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

    [description]

getLayerConfig

(
  • url
  • wmsName
)

Returns the feature layer config for the given url

Parameters:

  • url String
  • wmsName String

    WMS Layer name. Optional. Should only be provided if attempting to get a WMS layer.

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 hte sub-panel relative to the leftmost edge of the screen

getSymbolForFeature

(
  • feature
)
Icon

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:

Returns:

Icon:

The default icon used to represent the feature layer

getSymbolForLayer

(
  • layer
  • wmsName
)
Icon

Gets the default symbology icon from a layer's web service

Parameters:

  • layer Object

    A feature layer

  • wmsName String

    WMS Layer name. Optional. Should only be provided if attempting to get a WMS layer.

Returns:

Icon:

The default icon from the layer's symbology

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

loadStrings

()

Updates some of the Strings on the HTML page using the config string resources

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:363

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:373

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:341

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:352

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