ArcGIS JavaScript API – Alternatives to Google gmaps Utility Widget

arcgis-javascript-apigoogle maps

I have been using https://code.google.com/p/gmaps-utility-gis/ as a solution to displaying Google imagery as a base layer on a ESRI JSAPI map. With the advent of JSAPI 3.4 and full AMD support this solution is showing it's age.

Is this still the best/only* solution for showing Google imagery on a JSAPI map?

*ESRI indicates that the WebTiledLayer will show Google imagery but does not provide an example.

Best Answer

Google does not allow access to their tiles outside of their public APIs, from section 10.1.1 a of the Google Maps/Google Earth APIs Terms of Service:

No Access to Maps API(s) except through the Service. You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).

That is why the solution you linked to is necessary: it loads and uses the Google Maps API to load Google's map tiles (including imagery).

You can continue to use legacy modules (modules created with dojo.provide, dojo.require and dojo.declare) with the latest version of the JS API until we (Esri) move to Dojo 2.0 which will remove support for legacy modules. This is still several JS API releases away since Dojo 2.0 isn't out yet. Hopefully the author of that code will re-write it as an AMD module as I think it is still the best way to use Google tiles with the JS API.

Related Question