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);
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);
basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: false, basemaps: basemaps, bingMapsKey: bingKey, map: map });
When you say that my google maps wouldn't work off my hard drive, does that also mean that the bing maps won't work with the map gallery? Cause they aren't, and I'm trying to figure out why. All the other background imagery works, except any bing backgrounds. Google images would be ideal.
I've tried it from a folder on my hard drive, just opening the index.html
and
I've tried it from withing WebMatrix. no go.
http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/1.07/examples/gmapsgallery.html. This link not working. showing 404 error
onStreetViewVisibilityChange: function(turnOff) { // alert('herechange'); if(dojo.isChrome){ if(turnOff){ if(dojo.byId('map_Google Road')){ dojo.style(dojo.byId('map_Google Road'),'zIndex','15'); if(dojo.byId('gmaps_controls_')){ dojo.style(dojo.byId('gmaps_controls_'),'display','none'); } } }else{ if(dojo.byId('gmaps_controls_')){ dojo.style(dojo.byId('gmaps_controls_'),'zIndex','15'); dojo.style(dojo.byId('gmaps_controls_'),'display','block'); } if(dojo.byId('map_Google Road')){ dojo.style(dojo.byId('map_Google Road'),'zIndex','0'); } } } },
Hi All, it is quite easy to add Google's basemap to ArcMap, ArcGIS Online, Portal for ArcGIS, or an app using Esri's JavaScript API (including Web AppBuilder). It only takes a couple of lines of code. The problem is Google do not allow their basemap to be used unless you are using Google Maps' API for your application, or unless you get a letter from Google saying it is okay (their Terms and Conditions actually say this). I tried to get the letter from Google because I was using their imagery basemap for a Leaflet application I developed. They said no because our company was too small. If someone can point me to Google's Terms and Conditions or provide confirmation from Google that they allow their basemap to be used outside of a non-Google Maps API application, then I will be happy to put the details here to show you how to do it. It is very quick and only takes a couple of minutes. Note that when I first asked Google for permission to consume their tiled service directly outside of their API, they said it was technically not possible. I had to have a debate with them and prove that I had already done it before they believed me, and then they told me to stop using their tiled service immediately, unless I used the Google Maps API. If you really want to use Google's basemap, and you can't consume their service directly because of breaking their T&Cs, you can wrap their basemap in a Google Maps API app, and then put that inside your own app. This is a dirty hack, which is what we ended up doing.