Is it possible to add GoogleMapLayer as a basemap in ArcGIS JS 4.x 2D?

707
1
11-15-2019 04:02 AM
AlifShaikh
New Contributor

Hi,

Is it possible to add GoogleMapLayer as a basemap in ArcGIS JS 4.x 2D? if yes how to achieve the same.the below code is in 3.x. Any help would be greatly appreciated.

googleLayer = new agsjs1.layers.GoogleMapsLayer({
 id: 'google', // optional. esri layer id.
 apiOptions: { // load google API should be loaded.
 v: '3.6' // API version. use a specific version is recommended for production system.
 // client: gme-myclientID // for enterprise accounts;
 },
 mapOptions: { // options passed to google.maps.Map contrustor
 streetViewControl: false // whether to display street view control. Default is true.
 }
 });

Regards,

Alif

0 Kudos
1 Reply
TateM
by
New Contributor III

Alif,

I'm not 100 percent certain if you can add Google Maps as the basemap with ArcGIS JS API.  But I could be wrong, as it seems ArcGIS JS API have the esri/layers/WMSLayer and esri/layers/WMTSLayer classes that you could use to add Google Maps.  I think Google Maps is either a WMS or a WMTS, so it could be possible. 

On the other hand, I believe its possible if you go the other way around, using Google Maps API first and add ArcGIS Server map services on top of it.  At least according to this article from the link: https://octo.dc.gov/page/add-arcgis-server-dynamic-map-service-google-maps  

Hope this helps, would love to see it if you can make it work.

0 Kudos