stevel

Does the BaseMap Gallery support Google Maps as a Basemap?

Discussion created by stevel on Aug 8, 2011
Latest reply on Oct 18, 2013 by jeff.pace
A while ago, Derek Swingley showed how to use Google Maps as a background layer:

How about moving to the full ArcGIS API for JavaScript and using this sample to get Google Maps in your JS app:  http://gmaps-utility-gis.googlecode.com/svn/tags/gmapslayer/1.0/docs/examples.html


<script type="text/javascript" src="http://gmaps-utility-gis.googlecode.com/svn/tags/gmapslayer/1.0/src/gmapslayer_compiled.js" ></script>
var gMapLayer = new gmaps.GoogleMapsLayer({visible:false, id:'googlemaps'});
map.addLayer(gMapLayer);


This works really well when it's hard-coded (as long as your application is located on an externally-facing server - ie it won't work while testing on your hard drive).

Can this be integrated with the BaseMap Gallery? The BaseMap Gallery reference shows how to add a new basemap:

var layer = new esri.dijit.BasemapLayer({
  url:"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyBasemap/MapServer"
});
var basemap = new esri.dijit.Basemap({
  layers:[layer],
  title:"Public Safety",
  thumbnailUrl:"images/safetyThumb.png"
});
basemapGallery.add(basemap);


How can the Google Maps layer be used as the Basemap (which is expecting a BasemapLayer object)?

Thanks,
Steve

Outcomes