Skip To Content
ArcGIS Developer
Dashboard

Basemap Gallery

The Basemap Gallery widget displays a collection of basemaps from ArcGIS Online or a user-defined set of maps or image services. When a new basemap is selected from the Basemap Gallery, basemap layers are removed from the map and new layers are added. All basemaps added to the gallery need the same spatial reference. If default ArcGIS Online basemaps are used, all additional items added to the gallery need to be in the Web Mercator projection (well-known IDs [WKIDs]: 102100, 102113, and 3857). If default basemaps are not used, add basemaps in any spatial reference as long as all the items added to the gallery share that spatial reference. To achieve the best performance, all basemaps added to the gallery are cached (tiled) layers.

Configurable attributes

The following table describes the configurable attributes of the Basemap Gallery widget.

AttributeDescription

basemapGallery

An object of ArcGIS API for JavaScript. See the parameters of BasemapGallery Constructor.

  • basemaps—Object[]. There is no default. An array of user-defined basemaps to display in the Basemap Gallery. See the params of BasemapGallery Constructor.
  • layers—Object[]. There is no default. An array of layers to add to the basemap. See the params of BasemapGallery Constructor.
  • spatialReference—Object; There is no default. Specifies the WK ID of a spatial reference of the basemap.

Example

{
  "basemapGallery": {
    "showArcGISBasemaps": true,
    "basemaps": [{
      "layers": [{
        "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
      }],
      "title": "Street (Customized)",
      "thumbnailUrl": "images/streets.jpg",
						"spatialReference": {
          "wkid": "102100"
      }
    }, {
      "layers": [{
        "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
      }],
      "title": "Topo (Customized)",
      "thumbnailUrl": "images/topo.jpg",
						"spatialReference": {
          "wkid": "102100"
      }
    }, {
      "layers": [{
        "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
      }],
      "title": "Imagery (Customized)",
      "thumbnailUrl": "images/imagery.jpg",
						"spatialReference": {
          "wkid": "102100"
      }
    }]
  }
}