huffmanp

Setting the initial map extent in the Google Maps API

Discussion created by huffmanp on Dec 15, 2010
Latest reply on Dec 15, 2010 by huffmanp
I created a map app with the Google Map API to display one of my map services on a Google Map basemap.  I'd like to have the map app start with a map extent closer to the extent of my map service rather than the whole globe.  Sure, Google Map API is completely documented and I can find that the initial map extent is a property of the class esri.arcgis.gmaps.DynamicMapServiceLayer But I'm having trouble figuring out what the syntax is to add a property to the class is.  Are there any examples online? 

When I did this with an ESRI online basemap my initial extent was set with
var initExtent = new esri.geometry.Extent({"xmin":-13785833.373418408,"ymin":5680675.316201857,"xmax":-13006175.684909647,"ymax":6045127.06706556,"spatialReference":{"wkid":102100}});
        map = new esri.Map("map",{extent:initExtent});


I tried this with the Google MAP API but I get an syntax error right away in my IDE:
var dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer
        ("http://host119.yakama.com/ArcGIS/rest/services/facilitiesWGSWebMer2/MapServer",
        null, 0.75, dynmapcallback, initialExtent{"xmin":-13785833.373418408,"ymin":5680675.316201857,"xmax":-13006175.684909647,"ymax":6045127.06706556,"spatialReference":{"wkid":102100}});

Outcomes