2

here I see a question about tiled map services. But what about dealing with an arcgis server map service in a projected coordinate system like say 2278, how would I convert this to web mercator so that it will fall correctly in my map?

What are the choices using dynamic layer or other?

I don't have any control over the map service. Thanks.

1 Answer 1

3

If the map service you're using is a dynamic map service, create an ArcGISDynamicMapServiceLayer and add it to your map that already has one or more tiled web mercator services. Because dynamic map services can be projected on the fly, the ArcGIS API for JavaScript will construct an exportMap request where the resulting map image is in web mercator. You do not need to worry about building the request to exportMap– the API does this for you. The general workflow is as follows:

  • create your map (with or without an extent, if you specify an extent, it needs to be in web mercator if you're using tiled services in web mercator)
  • add a tiled web meractor service using ArcGISTiledMapServiceLayer
  • add your dynamic map service using ArcGISDynamicMapServiceLayer

If your map service that has a spatial reference of 2278 is tiled, you cannot overlay it on web mercator tiled services because tiled services cannot be reprojected on the fly.

One general takeaway from this is that your map's spatial reference has to match that of your tiled services. The map's spatial reference is defined by the spatial reference of the extent you pass to the map constructor, or the first layer that is added to the map.

2
  • Thanks. The map service I was trying to add was a tiled map service that is in a state plane (I assumed it was a non tiled map service). So I guess I can lay other dynamic map services onto it and they will reproject on the fly but I won't be able to used any basemap data as they will probably be in something other that a state plane and not reproject on the fly.
    – Justin
    May 15, 2012 at 2:58
  • I am not remember off the top of my head, but isn't it possible to force a tiled map service to be a dynamic service, assuming that the data to render is available? (that is not always the case) May 15, 2012 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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