undefined

API Docs for: 5.4.1
Show:

BaseMapSelector Class

Populates the BasemapGallery widget located in the maps toolbar with items found in the application configuration. This module also handles all the event needed to change the map basemap and update the UI

Uses RAMP Templates:

templates/basemap_selector_template.json

Imports RAMP Modules:

GlobalStorage Map EventManager Dictionary PopupManager Util TmplHelper

Methods

init

() Object private

Initiates additional UI components of the widget, setting listeners and registering the popup functionality

Returns:

Object:

itself

initListeners

() private

Initializes class listeners.

initTopics

() private

Initializes functions that publish events.

selectBasemap

(
  • basemapId
  • tileSchema
)
private

Selects a basemap in the basemapgallery based on the supplied basemap id. If the tileShema is different from the current one, reload the page.

Parameters:

  • basemapId String

    a basemap id used to select a basemap in the basemapgallery

  • tileSchema String

    a tileShema of the selected basemap

Events

BaseMapSelector.BASEMAP_CHANGED

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:661

Fires whenever the basemap changes

Event Payload:

BaseMapSelector.TOGGLE [subscribed]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:683

Changes the selected basemap

Event Payload:

  • evt Object

    the event object

    • id String

      the id of the basemap that is to be selected

BaseMapSelector.UI_COMPLETE

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:672

Fires after the basemap selector finished updating its UI (on page load)

Event Payload:

  • evt Object

    the event object

    • title String

      the title of the basemap that is selected