Reusable Accessible Mapping Platform

API Docs for: 5.0.0
Show:

Bootstrapper Class

Bootstrapper class. Starting point of RAMP, RAMP modules are loaded here and mapped to a function parameter Phase X?: For mobile support, there can be a different mobileBootstrapper with only the mobile modules loaded

Item Index

Methods

Events

Methods

_getFeatures

(
  • fl
)
Object

Queries all map points on a given feature layer and returns their attributes

Parameters:

  • fl Object

    A feature layer to query

Returns:

Object:

An array of attributes from the designated feature layer

_getField

(
  • fl
  • field
)
Object

Grabs all distinct values of the given field from a featureLayer.

Parameters:

  • fl Object

    A feature layer to query

  • field String

    The field (or column) to query in the feature layer

Returns:

Object:

deferred A deferred object which will resolve to an array of unique values

_hideLoadingImg

() private

Hides the loading image.

_initArrayPrototype

() Array private

Add extra functions to the Array object. Adds the following:

  • Array.remove() - prototype for removing items from array
  • Array.append(arr) - Add all the elements of the given array to this array.
  • Array.isEmpty() - Returns true if the length of the array is 0.
  • Array.last() - Returns true if the length of the array is 0.
  • Array.contains(obj) - Returns true if this Array contains the given object
  • Array.flatter(arr) - Array Flatten object extension: http://tech.karbassi.com/2009/12/17/pure-javascript-flatten-array/
  • Array.max() - Returns the max value in the array
  • Array.min() - Returns the min value in the array

Returns:

Array:

The array

_initDojoPrototype

() private

[_initDojoPrototype description] Adds following extensions:

  • topic.subscrive(name, listener, scope) - An extension of dojoLang.subscribe that allows the callback function to be hitched with the given scope.
  • dojoOn(target, type, listener, scope) -

_initEsriPrototype

() Array private

Add extra functions to the EsriExtent object. Adds the following:

  • EsriExtent.clone() -
  • EsriExtent.widht() -
  • EsriExtent.height() -
  • EsriExtent.xyAspectFactor() - Returns the ratio of this Extent's width to this Extent's height
  • EsriExtent.centerX() -
  • EsriExtent.centerY() -
  • EsriExtent.center() -
  • EsriExtent.pan() -

Returns:

Array:

The array

_initEventHandlers

(
  • map
)
private

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

Parameters:

  • map Object

    A ESRI map object

_initJQueryprototype

() Array private

Add extra jQuery functions. Adds the following:

  • $.findInputLabel() - Returns labels corresponding to the set of input controls.
  • $.isOverflowed() - Detects if the given span is overflowing with text

Returns:

Array:

The array

_initListeners

(
  • map
)
private

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

Parameters:

_initObjectPrototype

() Array private

Add extra functions to the Object object. Adds the following:

  • Object.create(o) - Takes an old object as a parameter and returns an empty new object that inherits from the old one

Returns:

Array:

The array

_initRepublishers

(
  • map
)
private

Republishes map events to the outside using topic.publish

Parameters:

_initScale

(
  • event
)
private

Initialize Map Scale

Parameters:

_initStringPrototype

() Array private

Add extra functions to the String object. Adds the following:

  • String.format() - format the string replacing the placeholders with provided values
  • String.replaceAll(search, replace) - replaces all instances

Returns:

Array:

The array

_loadLayer

(
  • layer
  • reloadIndex
)
private

This function initiates the loading of an ESRI layer object to the map. Will add it to the map in the appropriate spot, wire up event handlers, and generate any bounding box layers Note: a point of confusion. The layer objects "load" event may have already finished by the time this function is called. This means the object's constructor has initialized itself with the layers data source. This functions is not event triggered to guarantee the order in which things are added.

Parameters:

  • layer Object

    an instantiated, unloaded ESRI layer object

  • reloadIndex Integer

    Optional. If reloading a layer, supply the index it should reside at. Do not set for new layers

_showLoadingImg

() private

Shows the loading image.

_updateScale

(
  • event
)
private

Update Map Scale when zoom level changes

Parameters:

_wrapFileCallInPromise

(
  • readMethod
)
Function private

Helper function for wrapping File API calls in Promise objects. Used for building a series of helpers which call different file read methods.

Parameters:

  • readMethod String

    a string indicating the FileReader method to call

Returns:

Function:

a function which accepts a {File} object and returns a Promise

activate

() private

Highlights the given graphic object using the specified cssClass.

addLayer

(
  • layerType
  • layerConfig
  • initState
)

Add a provided layer to the layer selector.

Parameters:

  • layerType String

    layer type - name of the layer group

  • layerConfig Object

    a layer config

  • initState String

    optional. the state to initialize in. Default value is LOADING

addParameter

(
  • paramKey
  • paramObj
)
private

Update the parameter dictionary with the new values for the parameter. If paramObj is set to null, essentially removes the given paramKey from the URL.

Parameters:

  • paramKey String

    the parameter (e.g. extent) that was changed

  • paramObj Object

    an object representing data that can be serialized into the query parameter of the URL (can be null, in which case the parameter will NOT be included in the URL)

addProtytype

(
  • obj
  • name
  • fcn
)
private

Attempt to add the given fcn as a prototype to the given obj under the given name. Outputs a warning message to the console if a prototype of the same name already exists.

Parameters:

AddStaticFcn

(
  • obj
  • name
  • fcn
)
private

Attempt to add the given fcn as a static function to the given class under the given name. Outputs a warning message to the console if a function of the same name already exists.

Parameters:

AddStaticLayer

(
  • layer_type
  • layer_url
  • layer_op
)
private

Add a static, non-interactive Layer 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

adjustPanelWidth

()

Adjusts the width of the datagrid panel to accommodate the scrollbar.

adjustPaneWidth

() private

Changes the width of the layers pane to accommodate for the scrollbar if it's needed.

applyExtentDefaulting

() private

Apply extent defaulting prior to URL overrides.

applyExtentFilter

(
  • d
)

Gets all layer data in the current map extent that are visible, and put the data into the data grid.

Parameters:

  • d A Deferred object

cacheSortedData

() private

Caches the sorted data from datatables for feature click events to consume. Builds featureToPage as a mapping of (layerName,layerId) => page where layerName and layerId are strings and page is a zero based int.

capturePanel

(
  • force
)
private

Inherited from Datagrid but overwritten in src\js\RAMP\Modules\datagrid.js:1080

Captures a subpanel that was opened and docked by the datagrid module previously.

Parameters:

  • force Boolean

    if truthy - capture the panel even if the datagrid is not visible; use when switching to datagrid tab and the datagrid is not fully rendered yet by the browser

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

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

configReady

(
  • configObject
)
private

once the config file has been retrieved, proceed with the loading of the site

Parameters:

  • configObject Object

    the configuration object

createDatatable

() private

Creates a Data table based on the grid configuration specified in the application config object. See http://www.datatables.net/usage/columns for addition information on config parameters.

createGroups

() private

Sets UI status of a layer presentation (checkbox and eye) according to the user action: select / de-select a layer. publishes event "filterManager/box-visibility-toggled" every time a layer status changed. There should only be one eye and one global checkbox, but we say checkbox"es" because jquery returns a list and it's easier to write a function that takes a list of checkboxes than to write two functions, one to take a list and one to take an individual checkbox

createRowPrototype

(
  • cssClass
)
Object private

creates a datagrid row that has the following features: highlight for a give graphic un-highlight scroll to for a give graphic

Parameters:

  • cssClass String

    the style that highlights the row.

Returns:

Object:

an object containing features of a datagrid row

deactivate

() private

Removes a specified cssClass from a given graphic object in the data grid

deactivateAll

(
  • except
)
private

Deactivates all the tools. Used when closing the Advanced toolbar or when another tool is being activated.

Parameters:

  • except Tool

    A tool module that should not be deactivated.

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

enhanceFileFeatureLayer

(
  • featureLayer
  • opts
)

Will take a feature layer built from user supplied data, and apply extra user options (such as symbology, display field), and generate a config node for the layer. Accepts the following options:

  • renderer: a string identifying one of the properties in defaultRenders
  • color: color of the renderer
  • icon: icon to display in grid and maptips
  • nameField: descriptive name field for the layer
  • datasetName: description of the name field

Parameters:

  • featureLayer Object

    a feature layer object generated by makeGeoJsonLayer

  • opts Object

    An object for supplying additional parameters

enhanceLayer

(
  • layer
  • config
  • userLayer
)

Adds custom ramp properties to layer. Adds handlers to loading events.

Parameters:

  • layer Object

    layer to be prepped

  • config Object

    config object for the layer

  • userLayer Boolean

    optional. indicates if layer was added by a user. default value is false

fetchRecords

(
  • visibleFeatures
)
private

Populate the datagrid with data in visibleFeatures

Parameters:

  • visibleFeatures Array

    a dictionary mapping layer id to an array of feature objects

finishExtentProjection

(
  • projectedMaxExtent
)
private

process the projected maximum extent, then alert app to continue loading the map. used as an asynchronous gate for the projection.

Parameters:

  • projectedMaxExtent Array

    an array containing the maximum extent object in the map's projection

generateToggleButtonDataForTemplate

() String private

Generates a data grid row data with a checkbox to be used in template

Returns:

String:

the generated row data object.

getBoundingBoxMapping

() Object

Returns the mapping of feature layer ids to assocciated bounding box layers.

Returns:

Object:

A dictionary of String, Esri/layers/GraphicsLayer pairs.

getDataObject

(
  • feature
)
private

Given a map feature, return a data object used to represent the feature in the datagrid.

Parameters:

  • feature Object

    the feature needs to be represented in the datagrid return {Array} an array representing the data the given feature contains.

getFeatureLayer

(
  • featureId
)
Esri/layers/FeatureLayer private

Return the feature layer corresponding to the given id.

Parameters:

  • featureId String

    the id of the feature layer

Returns:

Esri/layers/FeatureLayer:

feature layer

getGraphicFromButton

(
  • buttonNode
)
Object private

Returns the graphic object of a feature layer which is contained in the given buttonNode.

Parameters:

  • buttonNode JObject

    the node containing the feature layer

Returns:

Object:

the graphic object of the feature layer.

getLayerItem

(
  • layerId
)
private

Returns a LayerItem object with specified layerId.

Parameters:

getLayerState

(
  • layerId
)
private

Returns the state of the layer with the specified layer id.

Parameters:

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

getNode

() Node: jObject, page: number private

Finds a row node corresponding to the given graphic object.

Returns:

Node: jObject, page: number:

} A row node that displays graphic information. If none found, returns an object with empty jNode.

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

getVisibleFeatureLayers

() Array

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

Returns:

Array:

an array of Esri/layers/FeatureLayer objects

handleGridEvent

(
  • e
  • callback
)
private

A handler that handlers the Enter key press and Click mouse event of the data grid. It is actually a binder that binds the key / mouse event to a handler specified. This is wired up to grid cells in the bootstrapper to achieve click/keypress functions

Parameters:

  • e Event

    the event object

  • callback Function

    the callback function

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

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.

highlightrowHide

() private

Un-highlights the row that is currently highlighted

highlightrowShow

(
  • event
)
private

Highlights the row according to the graphic stored in the event. Sets the hightlightRow variable to the graphic object inside the sent event

Parameters:

  • event Object

    A thrown event that contains a graphic object inside the grid

hoverLight

(
  • eventArg
)
private

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

Parameters:

hoverLightHide

() private

Clears the Hoverlight layer.

init

() private

Inherited from Navigation but overwritten in src\js\RAMP\Modules\bookmarkLink.js:196

Initiates additional UI components of the widget, setting listeners and other stuff.

init!~YUIDOC_LINE~! homePage a string denoting the name of the homePage (e.g. usually "Default.aspx" or "index.html")

()

Instantiates a BookmarkLink. Subscribes to all the events that causes the bookmark link to update (e.g. map extent change or feature layer visibility change).

initListeners

() private

Inherited from Navigation but overwritten in src\js\RAMP\Modules\datagrid.js:1520

Binding event handling for events: filterManager/layer-visibility-toggled datagrid/applyExtentFilter

initScrollListeners

() private

Inherited from FilterManager but overwritten in src\js\RAMP\Modules\datagrid.js:737

Apply's or removes the scrollbar from the data grid based on the height of its container.

initTooltips

() private

Inherited from FilterManager but overwritten in src\js\RAMP\Modules\datagrid.js:502

Initialize tooltips for the data grid

initTopics

() private

Listen to internal events and republish for other modules' benefit

initUIListeners

() private

Registers event handlers for following events:

datagrid/highlightrow-show datagrid/zoomlightrow-show datagrid/zoomlightrow-hide

isBookmarkLayer

(
  • layerId
)
Boolean private

Figures out if a layer is valid to be in the bookmark

Parameters:

  • layerId String

    layers id to check

Returns:

Boolean:

true if layer should be included in the bookmark

isReady

() Boolean

Indicates that the Data grid is fully rendered

Returns:

Boolean:

_isReady flag indicating the render status of the data grid

isVisible

() Boolean private

Checks if the datagrid currently visible, i.e., the data tab is selected on the side panel

Returns:

Boolean:

indicating if the datagrid is currently visible

load

(
  • id
  • req
  • load
)

Inherited from Prototype but overwritten in src\js\RAMP\Modules\gui.js:1292

Call load to initialize the GUI module.

Parameters:

  • id Number

    ID of this module

  • req Object

    dojo required, can be used to require additional modules, etc.

  • load Function

    The callback function to be called as the very last thing in load

loadLayer

(
  • layer
  • reloadIndex
)

Public endpoint to initiate the loading of an ESRI layer object to the map.

Parameters:

  • layer Object

    an instantiated, unloaded ESRI layer object

  • reloadIndex Integer

    Optional. If reloading a layer, supply the index it should reside at. Do not set for new layers

loadPlugin

(
  • pluginName,
)
private

loadPlugin takes a plugin file and loads it into the DOM. Creates a dynamic script tag to load the script at runtime.

Parameters:

  • pluginName, String

    the file name of the plugin to be loaded (should be in the plugins folder)

localProjectExtent

(
  • extent
  • sr
)
Esri/Extent private

Inherited from Map but overwritten in src\js\RAMP\Modules\map.js:420

Will project an extent to a desired spatial reference, using client side projection library. Avoids the need for Esri Geometry Service

Parameters:

Returns:

Esri/Extent:

extent in the desired projection

makeFeatureLayer

(
  • layerConfig
  • userLayer
)
Esri/layers/FeatureLayer

Create a new FeatureLayer object based on the config input

Parameters:

  • layerConfig Object

    config object for the layer to create

  • userLayer Boolean

    optional specifies if layer was added by a user

Returns:

Esri/layers/FeatureLayer:

feature layer object (unloaded)

makeGeoJsonLayer

(
  • geoJson
  • opts
)
FeatureLayer

Converts a GeoJSON object into a FeatureLayer. Expects GeoJSON to be formed as a FeatureCollection containing a uniform feature type (FeatureLayer type will be set according to the type of the first feature entry). Accepts the following options:

  • renderer: a string identifying one of the properties in defaultRenders
  • sourceProjection: a string matching a proj4.defs projection to be used for the source data (overrides geoJson.crs)
  • targetWkid: an integer for an ESRI wkid, defaults to map wkid if not specified
  • fields: an array of fields to be appended to the FeatureLayer layerDefinition (OBJECTID is set by default)

Parameters:

  • geoJson Object

    An object following the GeoJSON specification, should be a FeatureCollection with Features of only one type

  • opts Object

    An object for supplying additional parameters

Returns:

FeatureLayer:

An ESRI FeatureLayer

makeStaticLayer

(
  • layerConfig
  • userLayer
)
Object private

Return the static layer corresponding to the given url.

Parameters:

  • layerConfig Object

    config object for the layer to create

  • userLayer Boolean

    optional specifies if layer was added by a user

Returns:

Object:

layer object of the appropriate type

makeWmsLayer

(
  • layerConfig
  • userLayer
)
Esri/layers/WMSLayer

Return the feature layer corresponding to the given url.

Parameters:

  • layerConfig Object

    config object for the layer to create

  • userLayer Boolean

    optional specifies if layer was added by a user

Returns:

Esri/layers/WMSLayer:

WMS layer

navigateToRow

() Boolean private

Navigate to the page the row is in and scroll to it. Returns true if the row exists in the datagrid, false otherwise.

Returns:

Boolean:

A value indicating is the navigation is successful

newSubPanel

(
  • attr
)
SubPanel private

Create a new SubPanel with the settings provided.

Parameters:

Returns:

SubPanel:

A newly created SubPanel

onLayerError

(
  • layerId
  • newState
  • abortIfError
)
private

Inherited from LayerLoader but overwritten in src\js\RAMP\Modules\layerLoader.js:77

Will set a layerId's layer selector state to a new state.

Parameters:

  • layerId String

    config id of the layer

  • newState String

    the state to set the layer to in the layer selector

  • abortIfError Boolean

    if true, don't update state if current state is an error state

onLayerLoaded

(
  • evt
)

Reacts when a layer has loaded successfully. This means the site has shaken hands with the layer and it seems ok. This does not mean data has been downloaded

Parameters:

onLayerRemove

(
  • evt
)

Inherited from LayerLoader but overwritten in src\js\RAMP\Modules\layerLoader.js:431

Reacts to a request for a layer to be removed. Usually the case when a layer errors and the user clicks remove.

Parameters:

onLayerUpdateEnd

(
  • evt
)

Reacts when a layer has updated successfully. This means the layer has pulled its data and displayed it.

Parameters:

onLayerUpdateStart

(
  • evt
)

Reacts when a layer begins to update. This happens when a feature layer starts to download its data. Data download doesn't start until points are made visible. It also happens when a WMS requests a new picture.

Parameters:

prepLayer

(
  • layer
  • config
  • userLayer
)
private

Sets up loading event handlers and initializes the .ramp object of a layer Circular reference errors prevent us from calling LayerLoader directly from this module

Parameters:

  • layer Object

    layer to be prepped

  • config Object

    config object for the layer

  • userLayer Boolean

    optional. indicates if layer was added by a user. default value is false

projectConfigExtents

()

initiate the projection of the config extents to basemap extents

projectExtent

(
  • extent
  • sr
  • callWhenDone
)
private

project an extent to a new spatial reference, if required when projection is finished, call another function and pass the result to it.

Parameters:

projectFullExtent

(
  • projectedDefaultExtent
)
private

process the projected default extent, begin projection of full extent. used as an asynchronous gate for the projection.

Parameters:

  • projectedDefaultExtent Array

    an array containing the default extent object in the map's projection

projectMaxExtent

(
  • projectedFullExtent
)
private

process the projected full extent, begin projection of maximum extent. used as an asynchronous gate for the projection.

Parameters:

  • projectedFullExtent Array

    an array containing the full extent object in the map's projection

refresh

() Node: jObject, page: number private

Finds a row node corresponding to the given graphic object.

Returns:

Node: jObject, page: number:

} A row node that displays graphic information. If none found, returns an object with empty jNode.

removeLayer

(
  • layerType
  • layerId
)

Remove a layer from the layer selector.

Parameters:

  • layerType String

    layer type - name of the layer group

  • layerId String

    layer id of layer to remove

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.

republish

(
  • name
)
private

Republish map events using topic.publish

Parameters:

setBoundingBoxVisibility

(
  • layerId
)
private

Sets the visibility of the bounding box that belongs to the layer with the given layerId. Note: the layerId needs to be the ID of the featurelayer, not the ID of the actual bounding box layer.

Parameters:

  • layerId String

    the id of the layer whose bounding box visibility should be set

setButtonEvents

() private

Inherited from FilterManager but overwritten in src\js\RAMP\Modules\datagrid.js:530

Adds event-handling for buttons inside the data grid's row elements (i.e 'Details', 'Zoom To' buttons)

setLayerOffScaleState

(
  • layerId
)
private

Checks if a specific layer has data that is not visible and sets the appropriate layer state.

Parameters:

setLayerOffScaleStates

() private

Checks if any of the layers have data that is not visible and sets the appropriate layer state.

setLayerReorderingEvents

() private

Sets all the events to handle layer reordering with both mouse and keyboard.

setLayerState

(
  • layerId
  • layerState
  • [options]
)
private

Set the state of the specified layer to the provided value.

Parameters:

  • layerId String

    a layer id

  • layerState String

    a state to set the specified layer to

  • [options] Object optional

    additional options to be passed to the layerItem upon setting state

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

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:

slimCoord

(
  • value
)
private

If a co-ordinate has a big value before the decimal point, drop the precision after the decimal

Parameters:

  • value Object

    co-ordinate to potentially slim down

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.

subscribeAndUpdate

() private

Subscribe to map state changes so the URL displayed can be changed accordingly. SUBSCRIBES TO: map "extent-change" Updates URL when map extent changes

EventManager.GUI.FULLSCREEN_CHANGE Updates URL when map goes into fullscreen mode

EventManager.GUI.TAB_SELECTED Updates URL when tabs are selected

EventManager.GUI.PANEL_CHANGE Updates URL when panel opens/closes

EventManager.BasemapSelector.BASEMAP_CHANGED Updates URL when basemap changed

  • ================================================================

    Subscribe to updates

    To include more information into the query string, do not get the information directly from the object/module of interest, but rather make it publish an event with data to include and subscribe to this event here.

toggleShortLinkMode

(
  • value
)
private

Toggle the short/long link mode and change the label accordingly

Parameters:

  • value Object

    true - shortLinkMode; false - !shortlinkMore; undefined - toggle;

toggleToolbar

(
  • d
  • doOpen
)
private

Runs the open/close animation of the toolbar additionally managing the animation of adjusting the height of the details panel to accommodate the expanded toolbar.

Parameters:

  • d Deferred

    a deferred to be resolved upon completion of the animation

  • doOpen Boolean

    if true - the toolbar show open; if false - the toolbar should close

ui.addLayerGroup

() private

Add the provided layer group node to the layer selector ui.

ui.init

() private

Initiates additional UI components of the widget, setting listeners and other stuff.

ui.update

() private

Updates certain UI aspects like layer settings panel (visibility sliders for now only), layer visibility and bounding box toggles, and layer sorting.

updateConfig

(
  • homePage
)
private

Process the URL. If there are any parameters that came from a short-link, apply them to the config or the RAMP application

Parameters:

  • homePage String

    the page name of the ramp site (e.g. index.html, map.html)

updateDatasetSelectorState

(
  • state
  • [loaded]
)

Updates the state of the dataset selector based on whether the dataset has been loaded and what dataset is currently selected.

Parameters:

  • state Boolean

    indicates if button is disabled or not; true - disabled;

  • [loaded] Boolean optional

    indicates if the selected dataset is already loaded; it's assumed to be loading otherwise

updateHref

(
  • link
)
private

update Href on language button based on link provided from bookmarklink

Parameters:

updateNotice

() private

Update the datagrid notice to show feedback to the user if any. Right now is used to display notifications about scale dependent layers that are off scale at the moment.

updateURL

() private

Updates the link displayed in the textbox. This function should be called whenever one of the objects that are in the URL query is modified.

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.

zoomlightrowHide

() private

De-activates the row stored in zoomlightRow

zoomlightrowShow

(
  • event
)
private

Stores the graphic in the given event in the variable zoomlightRow

Parameters:

  • event Object

    A thrown event that contains a graphic object inside the grid

zoomToLayerScale

(
  • layerId
)

For a specified layer, zooms to the closest level that has some visible data.

Parameters:

  • layerId String

    a layer id to zoom to.

Properties

anchors

Object private

A dictionary mapping names (String) to anchors (String) used at the end of the URL.

baseLayer

Esri/layers/ArcGISTiledMapServiceLayer private

The basemap layer

boundingBoxMapping

Object private

Maps the id of a graphic layer to the GraphicsLayer Object that represents its extent bounding box. A dictionary of String, Esri/layers/GraphicsLayer pairs.

boundingBoxVisibility

Object private

A dictionary containing layer id (String) as key and bounding box visibility (boolean) as value

featureLayers

Array private

An Array of Esri/layers/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.

featureOidField

Unknown private

Name of the attribute used to store the oid in the details and zoomTo buttons

featureTypeToRenderer

Object private

Maps GeoJSON geometry types to a set of default renders defined in GlobalStorage.DefaultRenders

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

layerIdField

Unknown private

Name of the attribute used to store the layer id in the details and zoomTo buttons

layerTransparency

Object private

A dictionary with the layer id as key, and the transparency as value.

layerVisibility

Object private

A dictionary containing layer id (String) as key and layer visibility (boolean) as value

maxExtent

Esri/geometry/Extent private

The maximum extent of the map

oTable

Unknown private

The jquery table

parameters

Object private

A dictionary mapping names (String) to query parameter (String) of the URL. The query parameter is what ends up in the url. The key can be any arbitrary name (best to name them to describe the query parameter).

totalRecords

Unknown private

Total number of features in all the visible layers on the map

url

String private

The URL of the first layer of the basemap that is on by default.

wmsLayers

Array private

An Array of Esri/layer/WMSLayer objects.

Events

advancedToolbar.ADVANCED_PANEL_CHANGED

[Not Used]

BookmarkLink.BOOKMARK_GENERATED

Published when a new link has been generated.

Event Payload:

  • event Object
    • link String

      The bookmark URL that was generated

Datagrid.APPLY_EXTENT_FILTER [subscribed]

Applies a spatial filter to the datagrid (i.e. only visible points in the current extent will be displayed in the datagrid)

Datagrid.DRAW_COMPLETE

Fires when the table has finished drawing

Datagrid.EXTENT_FILTER_END

Fires when the extent-filter has finished updating

Datagrid.HIGHLIGHTROW_HIDE

Dehighlights the currently highlighted row.

Datagrid.HIGHLIGHTROW_SHOW

Highlights the row corresponding to the given graphic object of the selected feature.

Event Payload:

  • event Object
    • graphic Object

      ESRI graphic object corresponding to the selected feature

Datagrid.ZOOMLIGHTROW_HIDE

Dehighlights the currently zoomlighted row.

Datagrid.ZOOMLIGHTROW_SHOW

Zoomlights the row corresponding to the given graphic object of the zoomed to feature.

Event Payload:

  • event Object
    • graphic Object

      ESRI graphic object corresponding to the zoomed to feature

FeatureHighlighter.HIGHLIGHT_HIDE [subscribed]

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

FeatureHighlighter.HIGHLIGHT_SHOW [subscribed]

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 highlighted; tooltip stays put. Only one feature can be highlighted like this at a time.

Event Payload:

  • eventAttr Object

    ESRI feature click even attributes

FeatureHighlighter.HOVERLIGHT_HIDE [subscribed]

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

FeatureHighlighter.HOVERLIGHT_SHOW [subscribed]

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.ZOOMLIGHT_HIDE [subscribed]

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.ZOOMLIGHT_SHOW [subscribed]

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

FilterManager.BOX_VISIBILITY_TOGGLED

Published whenever the "box" button for a layer is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "box" button is checked, false otherwise

    • node Object

      the input dom node that represents the checkbox

FilterManager.LAYER_TRANSPARENCY_CHANGED

Published each time the transparency of a layer is modified.

Event Payload:

  • event Object
    • layerId String

      the id of the layer

    • value Int

      the value of the slider

FilterManager.LAYER_VISIBILITY_TOGGLED

Published whenever the "eye" button for a layer is clicked

Event Payload:

  • event Object
    • checked Boolean

      true if the "eye" button is checked, false otherwise

    • node Object

      the input dom node that represents the checkbox

FilterManager.SELECTION_CHANGED

Published whenever the layer list is rearranged

Event Payload:

  • event Object
    • id String

      the layer Id

    • index Integer

      index of the layer that moved. index is relative to the control, not the layer stack in the map

FilterManager.TOGGLE_BOX_VISIBILITY [subscribed]

Tells the filter manager to toggle a layer on or off

Event Payload:

  • event Object
    • layerId String

      the name of the layer to toggle

    • state Boolean

      true if the layer should be visible, false otherwise

FilterManager.TOGGLE_LAYER_VISIBILITY [subscribed]

Tells the filter manager to toggle a layer on or off

Event Payload:

  • event Object
    • layerId String

      the name of the layer to toggle

    • state Boolean

      true if the layer should be visible, false otherwise

FilterManager.UI_COMPLETE

Published after the ui for the filter manager finishes initializing.

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

GUI.DATAGRID_EXPAND

Fires whenever the extended grid button is clicked

GUI.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.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.LAYOUT_CHANGE

Published each time the layout changes.

GUI.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.PANEL_TOGGLE [subscribed]

Toggles the main panel (i.e. collapses it if was expanded, and expands it if it was collapsed)

GUI.SUBPANEL_CAPTURE [subscribed]

Attaches subPanel node to the module that calls it in the DOM hierarchy

Event Payload:

GUI.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.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.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.SUBPANEL_OPEN [subscribed]

Opens the subpanel

Event Payload:

GUI.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.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.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.TOOLBAR_SECTION_CLOSE

Published each time a toolbar section / widget is closed.

Event Payload:

  • evt Object

    the event Object

    • id String

      id of the source section / widget

GUI.TOOLBAR_SECTION_OPEN

Published each time a toolbar section / widget is opened. Used to close other toolbar sections / widgets.

Event Payload:

  • evt Object

    the event Object

    • id String

      id of the source section / widget

GUI.UPDATE_COMPLETE

Published when the gui module has completely finished rendering the UI. The bootstrapper should wait for this event to fire before initializing map.

LayerLoader.LAYER_ERROR

Indicates that a map layer has errored

Event Payload:

  • event Object
    • layer Object

      ESRI layer object that has errored

    • error Object

      the error object

LayerLoader.LAYER_LOADED

Indicates that a map layer has loaded. This means the constructor initialized and shook hands with it's data source

Event Payload:

  • event Object
    • layer Object

      ESRI layer object that has loaded

LayerLoader.LAYER_UPDATED

Indicates that a map layer has updated. This means the data it is showing is visible and up-to-date

Event Payload:

  • event Object
    • layer Object

      ESRI layer object that has updated

LayerLoader.LAYER_UPDATING

Indicates that a map layer has started updating. This means it is getting data from its source

Event Payload:

  • event Object
    • layer Object

      ESRI layer object that is updating

LayerLoader.RELOAD_LAYER

Indicates that a map layer should be removed from the map

Event Payload:

LayerLoader.REMOVE_LAYER

Indicates that a map layer should be removed from the map

Event Payload:

Maptips.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 currently highlighted row

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

Navigation.FULL_EXTENT

Published whenever the user clicks on the full extent button in the navigation widget.

Navigation.PAN

Published whenever the user clicks on the pan buttons.

Navigation.ZOOM

Published whenever the user tries to zoom using the slider.

Navigation.ZOOM_STEP

Published whenever the user tries to zoom using the arrow buttons.