Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Please review the code below for correctness. I am trying to display a Google basemap (hybrid) in a web map built on the ArcGIS Javascript API 3.8. I have a Google Maps API key, which was removed for this example. So far, I have reviewed the documentation here http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/1.05/docs/googlemapslayer/examples.html, but I am still stuck.

<script>
var djConfig = {
          parseOnLoad: true,
          packages: [{
            "name": "agsjs",
            "location": 'https://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' // for xdomain load
          }]
        };

<script src="http://maps.google.com/maps?file=api&amp;v=3&amp;key=" type="text/javascript"></script>
<script src="http://js.arcgis.com/3.8/"></script>

<script>
  dojo.require("dijit.layout.BorderContainer");
  dojo.require("dijit.layout.ContentPane");
  dojo.require("esri.map");
  dojo.require("agsjs.layers.GoogleMapsLayer");
  dojo.require("dijit.layout.TabContainer");
  dojo.require("esri.dijit.Legend");

  var map, googleLayer;

  function init() {
    map = new esri.Map("map", {
      center: [-82.65862, 29.820309],
      zoom: 16
    });

    googleLayer = new agsjs.layers.GoogleMapsLayer({
            id: 'google',
            apiOptions: {
              v: '3'
            },
    });

    map.addLayer(googleLayer);

  }

  dojo.ready(init);
share|improve this question
    
On a sidetrack, I still think this library breaches the terms of use of Google Maps API. "No "Wrapping." You must not create or offer a "wrapper" for the Service, unless you obtain Google's written consent to do so. For example, you are not permitted to: (i) use or provide any part of the Service or Content (such as map imagery, geocoding, directions, places, or terrain data) in an API that you offer to others; or (ii) create a Maps API Implementation that reimplements or duplicates Google Maps/Google Earth. " –  Simon Jan 23 at 22:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.