Equivalent of MapUnits and DistanceUnits in WPF Runtime

1794
2
09-23-2011 06:54 AM
Labels (1)
DarrenRempel
New Contributor III
Using the AxMapControl in ArcObjects, i can specify the MapUnits and Distance Units - how can I do the same in the WPF runtime?  Is this set by the map package?  If I programmatically load the World Street Map layer, the map units are in meters.
0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

The map units are determined by the spatial reference of the map. The map control does not support client-side reprojection on the fly in the same way the ArcGIS Engine MapControl does - so typically you do not explicitly set the spatial reference of the map but it is determined by the first layer you add. This is usually your "basemap" which will typically be a cached/tiled service (ArcGISTiledMapServiceLayer) or local tile cache (LocalTileCacheLayer in Beta 1). Other layers/services which are then added to the map need to match that projection. ArcGIS Server dynamic services and local ArcGIS Runtime dynamic services will support reprojection on demand.

The World Street Map service (http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) is in the Web Mercator Auxiliary Sphere projection (3857/102100) and the units for this projection are meters.

Cheers

Mike
0 Kudos
DarrenRempel
New Contributor III
Thanks Mike!  Alot of users still expect to see map scale in the user interface.  I would be handy if the toolkit provided an API or set of tools for developers to easily provide this to the end user instead of us having to do the calculations ourselves.  The same goes for a built-in API to accurately convert meters to other reference units such as lat/long, UTM etc.  ESRI seems to agree with this being that in ArcMap the map scale combo box is located front and center in the user interface.

Hi,

The map units are determined by the spatial reference of the map. The map control does not support client-side reprojection on the fly in the same way the ArcGIS Engine MapControl does - so typically you do not explicitly set the spatial reference of the map but it is determined by the first layer you add. This is usually your "basemap" which will typically be a cached/tiled service (ArcGISTiledMapServiceLayer) or local tile cache (LocalTileCacheLayer in Beta 1). Other layers/services which are then added to the map need to match that projection. ArcGIS Server dynamic services and local ArcGIS Runtime dynamic services will support reprojection on demand.

The World Street Map service (http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) is in the Web Mercator Auxiliary Sphere projection (3857/102100) and the units for this projection are meters.

Cheers

Mike
0 Kudos