Best practices:Reprojection (changing spatialreference) for layers within Map Control

4076
1
07-18-2012 11:59 AM
Labels (1)
BKuiper
Occasional Contributor III
What would Esri recommend for reprojecting all the layers within a Map Control ?

Assuming you already have a collection of layers exposed on your map, i would imagine doing the following:

1. Remove the layers from the Map control (but keep them alive as objects).

2. Set the desired spatial reference for the layers on the Map Extent property

3. re-add the layers to the map control

Where tiled layers probably wont be able to reproject (and wont' show up?)
Dynamic layers will automatically reproject
and Feature and GraphicsLayers have to be manually be reprojected using the Local.LocalGeometryService.Start() method ?

Is this correct ?
0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor
Hi,

Ideally you should try to avoid any on-the-fly reprojection of layers because it always incurs some degree of processing overhead, however small.

But often reprojection is unavoidable if you are mixing layers from different servers/organisations and this is the behavior:

- Tiled Layers: Cannot be reprojected either in the client application or on the server because the spatial reference is defined by the tiling scheme and the tiles are pre-rendered in that spatial reference.
- Dynamic layers: WILL be reprojected on the server (local server / online server) if required to match the spatial reference of the map control. This is on a per request basis and will involve a small processing overhead on the server.
- Feature / Graphics layers: WILL be reprojected by the client API if required to match the spatial reference of the map control and will involve a small processing and possible memory overhead in the client appplication.

To reproject individual, or specific sets of, graphics or features as you need you can use a [local] geometry service.

Cheers

Mike
0 Kudos