dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("esri.map"); var myMap; // global variable representing the map function init() { var initialExtent = new esri.geometry.Extent({"xmin":-13050590.679808607,"ymin":3848824.1306140213,"xmax":-13033430.566958608,"ymax":3863366.2752452563,"spatialReference":{"wkid":102100}}); myMap = new esri.Map("mapDiv", {extent:initialExtent}); var baseLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); var opLayer1 = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer",{ opacity:0.8 }); myMap.addLayers([baseLayer, opLayer1]); } dojo.addOnLoad(init);
var myMap; // global variable representing the map require([ "dijit.layout.BorderContainer", "dijit.layout.ContentPane", "dijit.layout.AccordionContainer", "esri.map", "esri.geometry.Extent", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/domReady!" ], function(BorderContainer, ContentPane, AccordionContainer, Map, Extent, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer) { var initialExtent = new Extent({"xmin":-13050590.679808607,"ymin":3848824.1306140213,"xmax":-13033430.566958608,"ymax":3863366.2752452563,"spatialReference":{"wkid":102100}}); myMap = new Map("mapDiv", {extent:initialExtent}); var baseLayer = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); var opLayer1 = new ArcGISDynamicMapServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer",{ opacity:0.8 }); myMap.addLayers([baseLayer, opLayer1]); });
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.