I have a map that uses ArcGIS Online in the small scales. So my map needs to be in Web Mercator in small scales. In the big scales, my web client Flex application uses some feature and map services to do some area and distance calculations. So my map needs absolutely to be in Lambert93, in the big scales, because geometric calculations in Web Mercator are not accurate at all.

=> I need to change the map spatial reference when I move from big/small scales to small/big scales. Is there a way to change the spatial reference of a map?



The answer to your Question is that is very much possible to change the spatial reference of your map, but only if you do not have any tiled layers in it.

To set the spatial reference, just make an new Exent in your required spatial reference, and then set your map's Extent to this extent. In Case you have some tiled layers, remove them before doing this.

However, I would not recommend that you do this.

If you just want to get the geodesic distances and areas, there is a better way. Just have a look at the GeometryUtil Class. You can use the geodesicAreas and geodesicLength functions to the dimensions in the required units.

This IMHO is a better way of achieving what you want.

  • Changing the extent, after removing ArcGIS Online Tiled services, didn't work. Have you ever done it? I need absolutely to change the spatial reference because in big scales, I do Route Task operations that perform on Lambert93 projected layers. – yo_haha May 3 '13 at 9:46
  • @yo_haha: I have used code along these lines in an application based on the 2.5 API to go from wgs84 to a custom LCC projection. Note that this was more than a year ago, and the behavior might have changed from 2.5 to 3.3 version of the API. – Devdatta Tengshe May 3 '13 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.