The Map's spatial reference is determined by the first layer in the map that has this property set. However, it can be overridden by explicitly setting the Extent property with an envelope that has a SpatialReference defined. This has to be done before any layers will be initalized by the map. Once the spatial reference of a map has been set and the layers has loaded, the spatial reference can no longer be changed. If you need to change spatial reference on the fly, you can instead create a new map instance, move the layers to this map, and replace the previous map instance. Also note that tiled layers does not support reprojection, and will not be displayed if the Map's SpatialReference does not match the spatial reference of the tiled layer.
To define an explicit spatial reference for the map, create an Envelope and assign your SpatialReference: <esri:Map x:Name="MyMap"> <esri:Map.Extent> <esriGeometry:Envelope XMin="661140" YMin="-1420246" XMax="3015668" YMax="1594451" > <esriGeometry:Envelope.SpatialReference> <esriGeometry:SpatialReference WKID="26777" /> </esriGeometry:Envelope.SpatialReference> </esriGeometry:Envelope> </esri:Map.Extent> <!-- Layer Definitions Here --> </esri:Map> Here you can find a live SDK sample too:http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DefineMapProjection
<esri:Map x:Name="MyMap"> <esri:Map.Extent> <esriGeometry:Envelope XMin="661140" YMin="-1420246" XMax="3015668" YMax="1594451" > <esriGeometry:Envelope.SpatialReference> <esriGeometry:SpatialReference WKID="26777" /> </esriGeometry:Envelope.SpatialReference> </esriGeometry:Envelope> </esri:Map.Extent> <!-- Layer Definitions Here --> </esri:Map>
The issue could be related to having different spatial references in your map service and the base map layer. Here you can find more information on how to resolve this problem.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.