How to add a local tiled layer

The following steps assume you have created a Windows Presentation Foundation (WPF) application in Visual Studio and are working in the Extensible Application Markup Language (XAML) view of the main page of your application.

Add a reference to ESRI.ArcGIS.Client.dll.

In XAML, add an Extensible Markup Language (XML) namespace that references the ArcGIS schema for WPF.

xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

Add the Map control element to a container element in the page. In this example, the container is a Grid. Use the ESRI.ArcGIS.Client namespace identifier, esri, to define the namespace that contains the Map control. Give the Map control a unique name using the x:Name attribute.

<Grid x:Name="LayoutRoot" Background="White">
        <esri:Map x:Name="MyMap" >
        </esri:Map>
    </Grid>

Add a local tiled layer to the map. The source property is the ArcGISLocalTiledLayer class, which has a Path property. The supported source is an ArcGIS Tile Package (.tpk), which can be authored in ArcMap. In the following code, the Path to the location of a tile package included with the installed software development kit (SDK) is set. You will need to replace this path with that of your own.

<Grid x:Name="LayoutRoot" Background="White">
        <esri:Map x:Name="MyMap" >
            <esri:ArcGISLocalTiledLayer ID="Topographic USA" Path="C:\Program Files (x86)\ArcGIS SDKs\WPF10.2.5\sdk\samples
\data\tpks\Topographic.tpk"/>
        </esri:Map>
    </Grid>

Compile and run your application.

1/27/2015