AnsweredAssumed Answered

Creating the map

Question asked by mclee021 on Mar 19, 2014
Latest reply on Mar 19, 2014 by timw1984dev
I've inherited a map that is set up in this manner.

      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("esri.map");
      dojo.require("dijit.layout.TabContainer");
                       
      var map;
    
function init() {
        map = new esri.Map("map", {
logo: false
        });

        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("Layer url goes here");
        var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer("Layer url goes here");

        dojo.connect(map, "onLayersAddResult", function(results) {
        });
        map.addLayer(basemap);
        map.addLayers([dynamicLayer]);
     }
     dojo.ready(init);

Is it possible to add home and basemap toggle buttons to the above? How can I do that? What is the difference between the above and the api sample code? e.g.

var map;
  require(["esri/map", "dojo/domReady!"], function(Map) {
    map = new Map("mapDiv", {
      center: [-56.049, 38.485],
      zoom: 3,
      basemap: "streets"
    });
  });

Outcomes