I like to use this old ESRI sample to help me when trying to set the initial extent in my apps... It works pretty well...SampleKen
I've had better luck modifying the xmin,xmax of the initial extent. When using the ESRI tiled base maps, it's not exact; you're always going to be tied to whatever scale is the nearest to the extent you specify.
var mylat = 29.818008; var mylong = -95.423178; var CenPoint = new esri.geometry.Point({ "x": mylat, "y": mylong, " spatialReference": { " wkid": 4326 } }); var mercator = esri.geometry.geographicToWebMercator(CenPoint); map.centerAt(mercator);
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.