Skip to content

Basemap Architecture

James Rae edited this page Oct 23, 2015 · 1 revision

The ESRI BasemapGallery dijit provides a nice utility for changing the basemap with very little code. It also allows you to stack multiple basemaps (e.g. a terrain layer and a labels layer) and treat them as a single basemap.

We would like to continue using this, but not have the API specific dijit be exposed outside of geoApi.

Note that we do not put the BasemapGallery dijit on the visible site. It remains hidden, and our own basemap switch UI utilizes the dijit to trigger the actual changing of layers on the map.

The main idea for the Basemap section of geoApi is that it will generate the BasemapGallery (which is populated with Basemap dijits), and return an object that both wraps the BasemapGallery and provides functions to interface with it (e.g. setBasemap(id))

The basemap list will come from the config structure, and be defined at the time of map creation. If a user wants to add a custom basemap, they will add the tile as a regular layer and position it at the bottom of the stack.