Skip to content

Instantly share code, notes, and snippets.

@benheb
Created April 10, 2013 16:04
Show Gist options
  • Select an option

  • Save benheb/5355978 to your computer and use it in GitHub Desktop.

Select an option

Save benheb/5355978 to your computer and use it in GitHub Desktop.
//var mapid = "e3b2c993ae3445acaa16cd5330c3b725";
var mapid = null;
if (mapid) {
esri.arcgis.utils.createMap(mapid, "map").then(function(response) {
self.map = response.map;
dojo.connect(dijit.byId("map"), "resize", self.map, self.map.resize);
});
} else {
this.map = new esri.Map("map",{
extent: extent
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer");
this.map.addLayer(basemap);
dojo.connect(this.map, "onLoad", function(map) {
dojo.connect(dijit.byId("map"), "resize", map, map.resize);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment