<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>ArcGIS JavaScript Extension for the Google Maps API Example</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <script src="http://maps.google.com/maps?file=api&v=3&key=AIzaSyDZlBLE1DNYj8IgCIP4JzkEVs8bclKfr90" type="text/javascript"></script> <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script> <script type="text/javascript"> var gmap = null; function initialize() { gmap = new GMap2(document.getElementById("gmap")); var centerat = new GLatLng(28,-82.5); gmap.addControl(new GLargeMapControl()); gmap.addControl(new GMapTypeControl()); gmap.setCenter(centerat, 10); var dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer("http://map.entrix.com/ArcGIS/rest/services/Misc/RiverviewOfficePointsWGS84/MapServer", null, 1.0, dynmapcallback); } function dynmapcallback(mapservicelayer) { gmap.addOverlay(mapservicelayer); } </script> </head> <body onload="initialize();" onunload="GUnload();"> <div id="gmap" style="width: 500px; height:500px;"></div> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>ArcGIS JavaScript Extension for the Google Maps API Example</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <script src="http://maps.google.com/maps?file=api&v=3&key=AIzaSyDZlBLE1DNYj8IgCIP4JzkEVs8bclKfr90" type="text/javascript"></script> <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script> <script type="text/javascript"> var gmap = null; function initialize() { gmap = new GMap2(document.getElementById("gmap")); var centerat = new GLatLng(28,-82.5); gmap.addControl(new GLargeMapControl()); gmap.addControl(new GMapTypeControl()); gmap.setCenter(centerat, 10); var dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer("http://map.entrix.com/ArcGIS/rest/services/Misc/RiverviewOfficePointsWebMerc/MapServer", null, 1.0, dynmapcallback); } function dynmapcallback(mapservicelayer) { gmap.addOverlay(mapservicelayer); } </script> </head> <body onload="initialize();" onunload="GUnload();"> <div id="gmap" style="width: 500px; height:500px;"></div> </body> </html>
Jeff, thanks for the suggestion. I tried that awhile back using a copy of the same data projected as Web Mercator Auxiliary Sphere. Here's the live version and the code below.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>ArcGIS JavaScript Extension for the Google Maps API Example</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <script src="http://maps.google.com/maps?file=api&v=3&key=AIzaSyDZlBLE1DNYj8IgCIP4JzkEVs8bclKfr90" type="text/javascript"></script> <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script> <script type="text/javascript"> var gmap = null; function initialize() { gmap = new GMap2(document.getElementById("gmap")); var centerat = new GLatLng(28,-82.5); gmap.addControl(new GLargeMapControl()); gmap.addControl(new GMapTypeControl()); gmap.setCenter(centerat, 10); var dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer("http://map.entrix.com/ArcGIS/rest/services/Misc/RiverviewOfficePointsWebMerc/MapServer", null, 1.0, dynmapcallback); } function dynmapcallback(mapservicelayer) { gmap.addOverlay(mapservicelayer); } </script> </head> <body onload="initialize();" onunload="GUnload();"> <div id="gmap" style="width: 500px; height:500px;"></div> </body> </html>
Still does not show the map service. Another clue from ESRI is shown in the following screen shot. When they tried to generate a token using the username and password I gave them on my ArcGIS Server, it apparently tries to find the map service using the internal hostname rather than the fully qualified URL. I think this is the problem! However I don't know what setting I need to adjust in ArcGIS Server configuration.
YEs thats totally it. You need to register for a new google key for your production server
webgis.entrix.com
For example, i have 4 seperate keys, localhost, internal development server, internal production server, public production server.
I then use a scriptlet to set the key in my html based on the hostname