Map Class
Map class represents the ESRI map object. The map is generated based on the application configuration and templates.
Item Index
Methods
- _getSymbolConfig
- _hideLoadingImg
- _initEventHandlers
- _initListeners
- _initRepublishers
- _initScale
- _showLoadingImg
- _updateScale
- AddStaticLayer
- adjustHeight
- adjustHelpDimensions
- adjustWidth
- adjutSubPanelDimensions
- captureSubPanel
- checkBoundary
- createExtent
- dockSubPanel
- getFeatureLayer
- getLayerConfig
- getSymbolForFeature
- getVisibleFeatureLayers
- hideSubPanel
- init
- initListeners
- initTopics
- layoutChange
- load
- loadStrings
- newSubPanel
- onFeatureDeselect
- onFeatureMouseOut
- onFeatureMouseOver
- onFeatureSelect
- republish
- showSubPanel
- subPanelChange
- toggleFooter
- toggleFullScreenMode
- toggleSubPanelContainer
Properties
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
Methods
_getSymbolConfig
-
layerUrl
Gets the defined symbology from a layer's web service
Parameters:
-
layerUrlStringA URL to the feature layer service
Returns:
The defined symbology from the layer definition
_initEventHandlers
-
map
Creates event handlers for the map control: click, mouse-over, load, extent change, and update events.
Parameters:
-
mapObjectA ESRI map object
_initListeners
-
map
Subscribe to external events (published using topic.publish) and react accordingly
Parameters:
-
mapObjectmap object
_initRepublishers
-
map
Republishes map events to the outside using topic.publish
Parameters:
-
mapObjectobject
AddStaticLayer
-
layer_type -
layer_url -
layer_op
Add a static, non-interactive Llyer to the map
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:
-
subPanelSubPanelSubPanel whose dimensions and position need to be adjusted
captureSubPanel
-
attr
Finds a SubPanel with origin equal to the supplied consumeOrigin and
- changes its
originto the suppliedorigin - moves the SubPanel in the DOM hierarchy and attaches it to the specified target
Parameters:
-
attrSubPanelSettingsSettings for the SubPanel; only
origin,consumeOriginandtargetare required here
checkBoundary
-
e -
maxExtent
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:
-
eEsri/geometry/Extentthe extent Object
-
maxExtentEsri/geometry/Extentthe maximum extent
Returns:
An adjusted extent, if the target extent is outside the boundary
createExtent
-
extentConfig -
sr
Instantiates an extent from a JSON config object and spatial reference
Parameters:
-
extentConfigObjectthe JSON config object
-
srEsri/SpatialReferencethe Esri/SpatialReference
Returns:
An ESRI extent object based on the config data
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:
-
attrSubPanelSettingsSettings for the SubPanel; only
targetandoriginare required here
getFeatureLayer
-
featureUrl
Return the feature layer corresponding to the given url.
Parameters:
-
featureUrlStringthe url of the feature layer
Returns:
feature layer
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:
-
featureObject
Returns:
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:
an array of Esri/layer/FeatureLayer objects
hideSubPanel
-
attr -
speed -
d
Closes the SubPanel whose origin is specified in the attr parameter.
Parameters:
-
attrSubPanelSettingsonly
originattribute is required here -
speedNumberDuration of the closing animation
-
dDeferredThe 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:
-
currentLevelObject
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.
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:
-
attrSubPanelSettingsSubPanel settings
Returns:
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.
onFeatureMouseOver
-
evt
This function is called whenever the user hovers over a feature on the map when another feature already has been selected.
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.
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:
-
attrSubPanelSettingsSettings 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:
-
fullscreenBooleantrue/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:
-
featureLayersesr/layer/featurelayersA list of feature layers found in the application config
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
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
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:
-
consumeOriginObject
gui.events.SUBPANEL_CHANGE
Published each time the subpanel opens/closes
gui.events.SUBPANEL_CLOSE [subscribed]
Closes the sub panel
Event Payload:
-
originStringthe 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:
-
originStringthe name of the module that requested to dock the subPanel (e.g. "filterManager")
-
targetJNodewhere to move the subPanel; if not supplied; sidePanel is used
gui.events.SUBPANEL_OPEN [subscribed]
Opens the subpanel
Event Payload:
-
attrSubPanelSettingsSettings 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
