Light Gray Canvas Map

696
3
10-04-2011 10:22 AM
MarkHoover
Occasional Contributor II
Are there any plans to add the Light Gray Canvas Map (as discussed here) to the Basemap Gallery?  Or can we already access it (and if so, is there a trick to doing so)?
0 Kudos
3 Replies
derekswingley1
Frequent Contributor
No plans yet.

You could add it to the default basemap gallery with something like this:
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: 'Av1bH4keF8rXBtxWOegklgWGCYYz8UGYvBhsWKuvc4Z15kT76xVFOERk8jkKEDvT',
    map: map
  }, "basemapGallery");
  basemapGallery.startup();

  dojo.connect(basemapGallery, 'onLoad', function(bm) {
    // find a base map to remove
    // in this case, it'll be the one named "Terrain"
    var bm = dojo.filter(basemapGallery.basemaps, function(bm) {
      return bm.title == 'Terrain';
    })[0];
    // remove the basemap from the gallery
    basemapGallery.remove(bm.id);

    // create a BasemapLayer and Basemap with the 
    // ligh gray basemap
    var grayLayer = new esri.dijit.BasemapLayer({
      url:"http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"
    });
    var grayBasemap = new esri.dijit.Basemap({
      layers:[grayLayer],
      title:"Light Gray",
      thumbnailUrl:"http://www.arcgis.com/sharing/content/items/8b3d38c0819547faa83f7b7aca80bd76/info/thumbnail/lightgray_thumb_webmap2.png"
    });
    // add the light gray basemap
    basemapGallery.add(grayBasemap);
  });
}


Or you can manually add it by building your own basemap gallery, see this sample:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/widget_basemapManual.html
0 Kudos
MarkHoover
Occasional Contributor II
Perfect, thanks, Derek.
0 Kudos
Robert_LeClair
Esri Notable Contributor
Mark - it would appear that the Light Gray Canvas is in the 10.1 Beta Basemap gallery.  But for 10.0 clients, Derek's approach works well.

Robert LeClair
Esri-Denver
0 Kudos