API Docs for: 0.0.8-0
Show:

Map Class

Map class represents the ESRI map object. The map is generated based on the application configuration and templates.

Methods

_getSymbolConfig

(
  • layerUrl
)
Esri/layer/symbology

Inherited from RAMP but overwritten in javascript\src\RAMP\Modules\ramp.js:96

Gets the defined symbology from a layer's web service

Parameters:

  • layerUrl String

    A URL to the feature layer service

Returns:

Esri/layer/symbology:

The defined symbology from the layer definition

_hideLoadingImg

(
  • event
)
private

Hides the loading image.

Parameters:

_initEventHandlers

(
  • map
)

Creates event handlers for the map control: click, mouse-over, load, extent change, and update events.

Parameters:

  • map Object

    A ESRI map object

_initListeners

(
  • map
)
private

Subscribe to external events (published using topic.publish) and react accordingly

Parameters:

_initRepublishers

(
  • map
)
private

Republishes map events to the outside using topic.publish

Parameters:

_initScale

(
  • event
)
private

Initialize Map Scale

Parameters:

_showLoadingImg

(
  • event
)
private

Shows the loading image.

Parameters:

_updateScale

(
  • event
)
private

Update Map Scale when zoom level changes

Parameters:

AddStaticLayer

(
  • layer_type
  • layer_url
  • layer_op
)

Add a static, non-interactive Llyer to the map

Parameters:

  • layer_type String

    A value which controls how the layer is going to be added to the map

  • layer_url String

    A URL pointing to a valid map service endpoint

  • layer_op Number

    A value between 0.0 and 1.0 which determines the transparency of the layer

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
)
private

Adjusts the dimensions and position of the SubPanel when layout of the page is changing.

Parameters:

  • subPanel SubPanel

    SubPanel whose dimensions and position need to be adjusted

captureSubPanel

(
  • attr
)
private

Finds a SubPanel with origin equal to the supplied consumeOrigin and

  • changes its origin to the supplied origin
  • moves the SubPanel in the DOM hierarchy and attaches it to the specified target

Parameters:

  • attr SubPanelSettings

    Settings for the SubPanel; only origin, consumeOrigin and target are required here

checkBoundary

(
  • e
  • maxExtent
)
Esri/geometry/Extent

Given an ESRI Extent Object, returns a new ESRI Extent Object that contains the extent adjusted according to this map's maximum extent

NOTE: this method is currently unused!

Parameters:

  • e Esri/geometry/Extent

    the extent Object

  • maxExtent Esri/geometry/Extent

    the maximum extent

Returns:

Esri/geometry/Extent:

An adjusted extent, if the target extent is outside the boundary

createExtent

(
  • extentConfig
  • sr
)
Esri/geometry/Extent private

Instantiates an extent from a JSON config object and spatial reference

Parameters:

  • extentConfig Object

    the JSON config object

  • sr Esri/SpatialReference

    the Esri/SpatialReference

Returns:

Esri/geometry/Extent:

An ESRI extent object based on the config data

dockSubPanel

(
  • attr
)
private

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 SubPanelSettings

    Settings for the SubPanel; only target and origin are required here

getFeatureLayer

(
  • featureUrl
)
Esri/layer/FeatureLayer private

Return the feature layer corresponding to the given url.

Parameters:

  • featureUrl String

    the url of the feature layer

Returns:

Esri/layer/FeatureLayer:

feature layer

getLayerConfig

(
  • url
)

Returns the feature layer config for the given url

Parameters:

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

getVisibleFeatureLayers

() Array

Returns a list of feature layers that are currently visible on the map.

Returns:

Array:

an array of Esri/layer/FeatureLayer objects

hideSubPanel

(
  • attr
  • speed
  • d
)
private

Closes the SubPanel whose origin is specified in the attr parameter.

Parameters:

  • attr SubPanelSettings

    only origin attribute is required here

  • speed Number

    Duration of the closing animation

  • d Deferred

    The deferred object to be resolved upon successful closing of the panel

init

(
  • currentLevel
)

Initialize navigaion widget for pan and zooming using global configuration object

Parameters:

initListeners

() private

Listen to map evens and adjust the navigation widget accordingly

initTopics

() private

Listen to internal events and republish for other modules' benefit

layoutChange

() private

Fires an event when the layout of the page changes.

load

(
  • id
  • req
  • load
)

Call load to initialize the GUI module.

Parameters:

  • id Number

    ID of this module

  • req ?

    ???

  • load Function

    The callback function

loadStrings

()

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

newSubPanel

(
  • attr
)
SubPanel private

Create a new SubPanel with the settings provided.

Parameters:

Returns:

SubPanel:

A newly created SubPanel

onFeatureDeselect

()

This function is called whenever the "Details" button is deselected (either by the user click on another "Details" button, clicking on another point, or by clicking on an already highlighted "Details" button, or clicking somewhere on the map where is no features present).

onFeatureMouseOut

(
  • evt
)

This function is called whenever the user moves the mouse away from a feature being hovered over.

Parameters:

  • evt Object

    [description]

    • graphic Object

      ESRI graphic object that is moved away from

onFeatureMouseOver

(
  • evt
)

This function is called whenever the user hovers over a feature on the map when another feature already has been selected.

Parameters:

  • evt Object

    [description]

    • graphic Object

      ESRI graphic object that is being hovered over

onFeatureSelect

(
  • evt
)

This function is called whenever the feature on the map is clicked/selected by the user. Publish the "Gui/subPanelOpen" message to indicate a feature has been selected. Panel content and Panel event handler information is passed in as the additional object for the event handler.

Parameters:

republish

(
  • name
)
private

Republish map events using topic.publish

Parameters:

showSubPanel

(
  • attr
)
private

Creates and opens a new SubPanel with given settings. If the SubPanel with the requested origin is already present, updates its content.

Parameters:

subPanelChange

(
  • visible
  • origin
  • container
)
private

Fires an even when the subpanel closes or opens.

Parameters:

  • visible Boolean

    indicates whether the panel is visible or not

  • origin String

    origin of the subpanel

  • container JObject

    subpanel container

toggleFooter

() private

Animate the footer during full-screen transitions.

toggleFullScreenMode

(
  • fullscreen
)
private

Toggles the FullScreen mode of the application

Parameters:

  • fullscreen Boolean

    true/undefined - expand; false - collapse

toggleSubPanelContainer

() private

Adjust the SubPanels to the full-screen mode of the page.

Properties

attributeLayers

Object private

Maps graphicsLayerId to a GraphicsLayer Object that represents an extent bounding box. A dictionary of String, Esri/layer/GraphicsLayer pairs.

baseLayer

Esri/layers/ArcGISTiledMapServiceLayer private

The basemap layer

boundingBoxLayers

Array of esri/layer/GraphicsLayer

A list GraphicsLayer that represent the extent bounding box of the feature layers.

Sub-properties:

  • featureLayers esr/layer/featurelayers

    A list of feature layers found in the application config

featureLayers

Array private

An Array of Esri/layer/FeatureLayer objects.

featureLayerStartIndex

Integer private

The map not only contains feature layers, but also other layers such as the basemap layer, highlight layer, bounding box layer, etc. This variable is used to store the starting index of the feature layers in the map.

fullExtent

Esri/geometry/Extent private

Used for full extent in nav widget

getMap

Object

Return the map control object

getMaxExtent

Object

The maximum extent of the map control is allowed to go to

InitExtent

Esri/geometry/Extent private

The initial extent of the map

maxExtent

Esri/geometry/Extent private

The maximum extent of the map

spatialReference

Esri/SpatialReference private

The spatial reference of the map

url

String private

The URL of the basemap that is on by default

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

gui.events.FULLSCREEN_CHANGE

Published each time fullscreen is toggled

Event Payload:

  • evt Object

    the event Object

    • fullscreen Boolean

      true if fullscreen is on, false if fullscreen is off.

gui.events.HELP_PANEL_CHANGE

Published each time the help panel opens or closes.

Event Payload:

  • evt Object

    the event Object

  • visible Boolean

    true if the help panel is opened, false if the help panel is closed

gui.events.LAYOUT_CHANGE

Published each time the layout changes.

gui.events.PANEL_CHANGE

Published each time the panel opens/closes

Event Payload:

  • evt Object

    the event Object

    • visible Boolean

      true if the panel is opened, false otherwise

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:

gui.events.SUBPANEL_CHANGE

Published each time the subpanel opens/closes

Event Payload:

  • evt Object

    the event Object

    • visible Boolean

      true if the subpanel is opened, false otherwise

    • origin String
    • container JObject

      jQuery reference to the sub-panel container

gui.events.SUBPANEL_CLOSE [subscribed]

Closes the sub panel

Event Payload:

  • origin String

    the 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 String

    the name of the module that requested to dock the subPanel (e.g. "filterManager")

  • target JNode

    where to move the subPanel; if not supplied; sidePanel is used

gui.events.SUBPANEL_OPEN [subscribed]

Opens the subpanel

Event Payload:

gui.events.TAB_DESELECTED

Fires whenever a tab has been deselected in the main panel

Event Payload:

  • evt Object

    the event Object

    • id String

      the id of the deselected tab

    • tabName String

      the name of the deselected tab

gui.events.TAB_SELECTED

Fires whenever a tab has been selected in the main panel

Event Payload:

  • evt Object

    the event Object

    • id String

      the id of the selected tab

    • tabName String

      the name of the selected tab

gui.events.TOGGLE_FULLSCREEN [subscribed]

Toggles the fullscreen

Event Payload:

  • evt Object

    the event Object

    • expand Boolean

      true if we should go into fullscreen mode, false if we wish to collapse to normal mode. If undefined, it toggles the fullscreen (i.e. make it fullscreen if it was not, make it collapse to regard mode if it was fullscreen).

gui/add-layer-panel-change

Published each time the Add Layer panel opens or closes.

Event Payload:

  • evt Object

    the event Object

  • visible Boolean

    true if the AddLayer panel is opened, false if the AddLayer panel is closed