ArcGIS extension for Google Map

3843
5
11-28-2012 02:35 PM
PabitraDash
New Contributor
The sample code provided to use this extension works only to display the google map. The ArcGIS map overlay doesn't work. It seems the extension version 1.6 works for google map api version 2 which is no more available. I changed the sample code to use the google map api version 3 which displays the google map. However, I am getting error at the following statement (esri is not defined):

var dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer
          ("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapSer...",
          null, 0.75, dynmapcallback);

I am using the following scripts:
     <script src="https://maps.googleapis.com/maps/api/js?key=mykey&sensor=false"></script>
    <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script>
    <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0" type="text/javascript"></script>

Thanks.
PK
0 Kudos
5 Replies
JohnGravois
Frequent Contributor
i checked the following sample and it seems to display an ArcGIS Server service over a Google basemap without error.

the Esri extension API is not compatible with Version 3 of Google Maps API.  see the following link for more info.
0 Kudos
MattO_Hara
New Contributor
I haven't actually used this library but there is this API here: gmaps-utility-gis

It allows you to use Google basemaps with esri. By pulling up a console on this example I was able to add this dynamic service to the map with the following:

map.addLayer(new esri.layers.ArcGISDynamicMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Specialty/Soil_Survey_Map/MapServer"))
0 Kudos
PabitraDash
New Contributor
I found my problem in accessing the ArcGIS javascript API. My web server is running on SSL and blocks access to http resources like the ArcGIS JS API. But I am not sure how to solve this problem. How can I access http content from a https web page?

PK
0 Kudos
JohnGravois
Frequent Contributor
it'd probably be easier to just reference the JS API via SSL as well

ie.
https://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6
0 Kudos
PabitraDash
New Contributor
it'd probably be easier to just reference the JS API via SSL as well

ie.
https://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6


Thanks. I thought I did change from http to https and it didn't work. But it seems to work fine now.

PK
0 Kudos