You are using a browser that is no longer supported. Please use the latest version of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information please see the System Requirements.
Skip To ContentArcGIS for DevelopersSign In Dashboard

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

This sample demonstrates how to create a custom basemap and add it to the BasemapToggle widget in a SceneView. The basemap is a simple container of baseLayers and reference layers.

A WebTileLayer is created from a third-party cached service and added to a new basemap's baseLayers property so it can be used as an alternate basemap.

// Create a WebTileLayer with a third-party cached service
var mapBaseLayer = new WebTileLayer({
  urlTemplate: "https://stamen-tiles-{subDomain}{level}/{col}/{row}.png",
  subDomains: ["a", "b", "c", "d"],
    'Map tiles by <a href="">Stamen Design</a>, ' +
    'under <a href="">CC BY 3.0</a>. ' +
    'Data by <a href="">OpenStreetMap</a>, ' +
    'under <a href="">CC BY SA</a>.'

// Create a Basemap with the WebTileLayer. The thumbnailUrl will be used for
// the image in the BasemapToggle widget.
var stamen = new Basemap({
  baseLayers: [mapBaseLayer],
  title: "Terrain",
  id: "terrain",
  thumbnailUrl: ""

// Add the custom basemap to the map
var map = new Map({
  basemap: stamen,
  ground: "world-elevation"

Sample search results