Dynamic workspace shapefile

This sample demonstrates how to dynamically add a local shapefile to a map using Local Server.

Note:

In ArcGIS Runtime SDK for .NET, Local Server is only supported for WPF apps.

Shapefile layer added from Local Server

Instructions

This sample depends on the local server being installed and configured. See the Local Server developers guide topic for details and instructions. Click on the Choose Shapefile button to select a shapefile. The file picker will start in the sample viewer's offline data directory. Sample shapefiles are loaded in the background.

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.DynamicWorkspaceShapefile.DynamicWorkspaceShapefile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button x:Name="MyChooseButton" Content="Choose shapefile" Grid.Row="0" IsEnabled="False" Click="MyChooseButton_Click" />
        <esri:MapView x:Name="MyMapView" Grid.Row="1" />
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code