Map service will not display over Google base layer

1035
6
07-11-2012 11:14 AM
CurtWalker
New Contributor
I have followed this tutorial and literally copied and pasted the code, the only thing I changed was to add my own unsecured map service in place of the ESRI layer.  This map service works in every other web-mapping application I have tested it with - JS and FLEX Viewer.  It does not appear over the Google layer though.  I have an open support ticket with ESRI that's been going for several weeks now.  Their developers agree that the code is valid and they have even duplicated the problem by trying to pull this same map service from my ArcGIS Server.  At this point ESRI is not able to provide a solution.  I believe there is a server configuration that needs to be changed because they were able to get a copy of this data and created their own service with it, and that worked.

Likewise, I've seen numerous web-maps where this same method of adding an in-house map service over the Google base layer works flawlessly.

I'm hoping someone has run into this and figured out a fix.

Here's the live map that will not display my map service.  My code is below.  Thanks for your help!

<!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>
0 Kudos
6 Replies
JeffPace
MVP Alum
I think you need to use a web merc aux sphere service (not wgs84) to overlay.  Check out the coordinate system of the working sample.
0 Kudos
CurtWalker
New Contributor
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.
0 Kudos
JeffPace
MVP Alum
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
0 Kudos
JeffPace
MVP Alum
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


Actually check that, v3 api no longer requires a key

https://developers.google.com/maps/signup

maybe just try removing it?
0 Kudos
CurtWalker
New Contributor
I did already generate a key for each domain I'm calling from.  Removing the key causes the page to fail to load.

I don't think I explained the problem very well.  In order for ESRI to test this I created a user account in ArcGIS Server Manager so they could generate a token for this service I'm trying to overlay on the Google base layer.  When I generate a token it works, but when ESRI tries it fails to generate a token:

[ATTACH=CONFIG]16000[/ATTACH]

The reason this may be relevant is because the Google API (or extension) may be acting like an external user and it may be getting back the same address that ESRI got when they tried to generate a token.  In other words, it may be getting the internal hostname instead of a fully qualified URL.  This is what I'm trying to get across to ESRI and find out where I can fix this in the server configuration.
0 Kudos
SaraHintze
New Contributor
Did anyone ever resolve this issue? I am having the same problem with an operational layer not displaying. It works fine internally/intranet, but not externally/internet . I have changed the ArcGIS Server Output directory to the fully qualified URL, rather than the default \\servername\arcgisoutput, but this did not fix the issue. Any suggestions would be appreciated.
0 Kudos