Wondering if it is possible to toggle between two basemaps with that have a different wkid and tile structure?

I have tried with a basemap gallery and a basemap toggle with no luck. We have one custom basemap and are trying to use the world imagery for the second. Is this possible? If not is there a way around it, by using something like a ArcGISImageServiceLayer?

Here are the examples I have been going off of: https://geonet.esri.com/message/438609#438609

1 Answer 1


In the ArcGIS JavaScript API, the projection/tile layers of the map are controlled by the first tiled layer loaded. There's no easy way to swap that out on the fly. That being said, there are two approaches you could take.

  1. In the ArcGIS JavaScript API, call map.destroy() to delete the map instance, and reload all the layers, including the new basemap, onto the new map. Any graphics added to the map before will either be lost, or must be reprojected before adding them to the map.

  2. In the .mxd of your custom basemap, change the data frame projection to web mercator auxiliary sphere (wkid 102100), and share as a new tiled map service using the existing Google/Bing/ArcGIS tile scale schema (or your own tile schema conf.xml file if you need map scales below 1:1128). Because you're tiling the layers using ESRI's schema, it should swap out easily with the world imagery basemap, and you'll get the speed of a tiled service. You'll only notice reprojection delays if you query your custom basemap layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.