Define Map Projection

This sample demonstrates how to define the map projection of local layers in the map. The extent property of the map is set to an envelope. The envelope's projection id (WKID) defines the spatial reference for the map and reprojects the local dynamic layer for display in the map. Tiled map service layers will not (should not) be reprojected on the fly. For optimal performance, confirm that the tiled map service layers have the same spatial reference as that defined for the map.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalDefineMapProjection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009" >
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>        
        </Grid.Resources>
        <esri:Map x:Name="MyMap" Background="#FFE3E3E3" >
            <esri:Map.Extent>
                <esri:Envelope XMin="-15000000" YMin="2000000" XMax="-7000000" YMax="8000000">
                    <esri:Envelope.SpatialReference>
                        <esri:SpatialReference WKID="102100"/>
                    </esri:Envelope.SpatialReference>
                </esri:Envelope>
            </esri:Map.Extent>
            <esri:ArcGISLocalDynamicMapServiceLayer ID="DynamicLayer"
                      Path="..\\Data\\MPKS\\USCitiesStates_Lambert_Conformal_Conic.mpk"/>
        </esri:Map>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014