shaningesri

Question about an ESRI's sample code for Cached Map

Discussion created by shaningesri on Jul 16, 2011
Latest reply on Jul 18, 2011 by DSwingley-esristaff
This is regarding one of ESRI's sample code in ArcGIS Extension for Google Map API.  For How to Add ArcGIS Server Cached Map (at http://help.arcgis.com/en/webapi/javascript/gmaps/help/google_samplestart.htm, the topic is /Map/Add ArcGIS Server cached map), ESRI provides a smaple code at
http://help.arcgis.com/en/webapi/javascript/gmaps/samples/maps/map_cached.html.
On Lines 30 and 32 of this script, a variable  gTileLayer  is used.

      //create custom tile layer - Line 26
      var tiledmap = new esri.arcgis.gmaps.TiledMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer", mapOptions, addTiledMap);
    }

    function addTiledMap(gTileLayer) {   // Line 30 
    //Add tile layer as a GTileLayerOverlay using mapExtension
      gOverlays = mapExtension.addToMap(gTileLayer);  // Line 32    }

However, this variable is not defined before.  I wonder how a tiled layer can be added on the map.  I wish ESRI can provide an answer for it.  Thanks.

Outcomes