setting initial extent on arcgis.com world map

739
1
Jump to solution
05-23-2012 08:01 AM
johnjackson2
New Contributor
Hello all.

I'm trying to set up a custom web map on my site. The coordinates I have come from our existing GIS that is projected in NAD 83, Ohio South Zone.
I've been able to get the sample world map to work, but when I try to put my own coordinates into the extent, I end up in Africa.

I'm not sure if I'm specifying the extent correctly, or if there's something bigger I'm missing completely.
The relevant code is:
            var initExtent = new esri.geometry.Extent({ "xmin": 1800192, "ymin": 706814, "xmax": 1810000, "ymax": 770000, "spatialReference": { "wkid": 3735} });             map = new esri.Map("map", { extent: initExtent});


Thanks in advance for any help.
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Frequent Contributor
ArcGIS.com base map services are in web mercator. The extent you specify also needs to be in web mercator. There isn't a client side method in the API to convert from your specific spatial reference to web mercator so you would need to use a the geometry service to project your extent. I would recommend doing this before hand and hard coding it in your app rather than hitting a geometry service each time your app loads.

View solution in original post

0 Kudos
1 Reply
derekswingley1
Frequent Contributor
ArcGIS.com base map services are in web mercator. The extent you specify also needs to be in web mercator. There isn't a client side method in the API to convert from your specific spatial reference to web mercator so you would need to use a the geometry service to project your extent. I would recommend doing this before hand and hard coding it in your app rather than hitting a geometry service each time your app loads.
0 Kudos