API Docs for: 0.0.8-0
Show:

FeatureHighlighter Class

A class responsible for highlighting points, lines, and shapes on the map upon selection and consequent hover actions. The highlighting is achieved by manipulating svg rendering of the map as follows:

  • all existing feature layers are wrapped into a group object
  • three more group objects are created:
    • highlight group is positioned after the graphicGroup
    • zoomlight group is positioned before the graphicGroup
    • hoverlight group is positioned before the zoomlight group

and changing the opacity of the graphicGroup while adding shapes to one or more of the additional group objects.

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

    [description]

cloneGraphic

(
  • graphic
)
private

Creates a copy of the given graphic object.

Parameters:

  • graphic Object

    Graphic object to clone

Returns:

clone A cloned Graphic object

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

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

highlightGraphic

(
  • eventArg
)
private

Clones the Graphic object from the event, adds it to the Highlight layer, and lowers the opacity of other map layers to make the cloned Graphic stand out.

Parameters:

highlightGraphicHide

() private

Clears the Highlight layer and restores the opacity of the map layers.

hoverLight

(
  • eventArg
)
private

Clones the Graphic object from the event, adds it to the Hoverlight layer.

Parameters:

hoverLightHide

() private

Clears the Hoverlight layer.

init

()

Initiates the FeatureHighlighter static class.

initListeners

() private

Initiates various listeners for the class.

repositionInteractive

() private

If there a Graphic in the Highlihgh layer, resets it's bounding box and repositions an interactive maptip to match the top center of the boudning box of the highlighted graphic.

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

sortLayers

() private

Sorts and groups the svg representation of the map layers on the page to make highlighting work. Group all the feature layers and create new groups for highlight, zoomlight, and hoverlight layers.

zoomLight

(
  • eventArg
)
private

Clones the Graphic object from the event, adds it to the Zoomlight layer, and lowers the opacity of other map layers to make the cloned Graphic stand out.

Parameters:

zoomLightHide

() private

Clears the Zoomlight layer and restores the opacity of the map layers if the Highlight layer is empty.

Attributes

getConfigUrl

readonly

Returns 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

Events

featureHighlighter.events.HIGHLIGHT_HIDE [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:284

Dehighlights a currently highlighted feature on the map and restores opacity of the rest of the layers; hides the interactive tooltip.

featureHighlighter.events.HIGHLIGHT_SHOW [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:273

Permanently highlights a given feature on the map; display an interactive tooltip for this feature; reduces opacity of the graphicGroup layers. Even when the user moves the cursor away, the feature stays highlihgted; tooltip stays put. Only one feature can be highlighted like this at a time.

Event Payload:

  • eventAttr Object

    ESRI feature click even attributes

featureHighlighter.events.HOVERLIGHT_HIDE [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:304

Dehighlights a currently highlighted (hoverlighted) feature on the map without restoring opacity of the rest of the layers;

featureHighlighter.events.HOVERLIGHT_SHOW [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:293

Temporarilly highlights (hoverlights) a given feature on the map. Intended to be dehighlighted when the user moves the cursor away; to do that, publish HOVERLIGHT_HIDE event. Effect is only visible when another feature is already permanently highlighted. Only one feature can be highlighted like this at a time.

Event Payload:

  • eventAttr Object

    ESRI feature click even attributes

featureHighlighter.events.ZOOMLIGHT_HIDE [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:324

Dehighlights a currently highlighted (zoomlighted) feature on the map; Removes the tooltip. Restores the opacity of the graphicGroup layers if no feature is highlighted at present.

featureHighlighter.events.ZOOMLIGHT_SHOW [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:312

Temporarilly highlights (zoomlightes) a given feature on the map. Intended to be dehighlighted when the user makes an action like panning or zooming the map, publish ZOOMLIGHT_HIDE event. Displays a temporary tooltip for this feature; Only one feature can be highlighted (zoomlighted) like this at a time.

Event Payload:

  • eventAttr Object

    ESRI feature click even attributes

maptips.events.EXTENT_CHANGE [subscribed]

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 currenlty highlighted row

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 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.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 JObject

    a node/svg object the user hovered over

  • graphic Object

    ESRI 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 JObject

    a node/svg object the user hovered over

  • graphic Object

    ESRI graphic object belonging to the target