Change the "basemap" option in the Map class

658
3
03-26-2014 08:48 AM
SaqibAmin1
New Contributor
Does anyone know how to amend the basemap option below, so that I can add a dynamic map service (...../mapserver) instead of the ArcGISonline map?

I know about  e.g. map.addLayers(dynamicMapService), however I want to see if there is a a way to amend the below.

      map = new Map("map", {
        basemap: "topo"
      }
0 Kudos
3 Replies
JeffPace
MVP Alum
0 Kudos
ralphholmes
New Contributor III
add the code

BaseMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer ("rest server location");

map.addLayers([BaseMapLayer])
0 Kudos
SaqibAmin1
New Contributor
Thanks for your replies, Jeff and Ralph.

Ralph, I have already tried this method, the dynamic map displays on the page, however I wanted to amend the basemap property in the map object, so that instead of using ArcGISOnline pre-defined maps, my dynamic map services are used as a basemap.

Jeff, I will have a look at the class definitions and see if I can make sense of it.
0 Kudos