I am trying to put two layers in the map. One layer is my own data served from our ArcGIS Server instance, the other one is the ESRI world street basemap layer. The two layers overlay on top of each other perfect (i.e. my data appears over the street map exactly where it is supposed to):
http://www.northmiamicra.org/testjsapi.html
However, when I try to set the initial extent of the map to be the initial extent of my own data (North Miami, Florida), it does zoom to the initial extent of my data, but for some reason it overlays it with the World Street Map in Nigeria! Why is this happening?
http://www.northmiamicra.org/test2layers.html
FYI, the code in the second link is virtually identical to the sample code found here:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/map/map_setextent.html
The only thing I changed in the sample code was that I removed the geographicToWebMercator function because my data is already in Transverse Mercator.
Thanks for the reply hzhu,
I think what you mean is that the reason the two layers do not overlay on top of each other correctly is that they are on different projection systems. (My data is on Transverse Mercator (actually it is UTM, but for some reason ESRI has always called UTM simply Transverse Mercator) and the data in the Service is on "Web Mercator"). But if this is the case then it brings up two questions:
1) Why do the two services overlay perfectly fine if I do not specify an extent (as in the first link I showed)?
2) Why do I need to have the two layers on the same projection system? ArcMap will reproject data on the fly if they are on different projection systems. Evidently from the examples I have posted so does ArcGIS Server but it does not work when a new extent is specified?