//add the legend dojo.connect(map, 'onLayersAddResult', function(results) { console.log("on layers add result: ", results); var layerInfo = dojo.map(results, function(layer, index) { return { layer: layer.layer, // title: layer.layer.name // name property is undefined... title: "Bike Facilities" }; }); if (layerInfo.length > 0) { var legendDijit = new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, "legendDiv"); legendDijit.startup(); } });
createBasemapGallery();
//resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map, map.resize); }
function createBasemapGallery() { //add the basemap gallery, in this case we'll display maps from ArcGIS.com including bing maps var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, bingMapsKey: 'A1GXEbIE8xrnP3IbNrLVIqRfH1FLjVX53xuqCMqM2Y1Cvp_ugYoFdPn-Sn2XyX9Q', map: map }, "basemapGallery");