Feature layer (shapefile)

View on GitHub

Open a shapefile stored on the device and display it as a feature layer with default symbology.

Image of feature layer shapefile

Use case

Shapefiles store location, shape and attributes of geospatial vector data. Shapefiles can be loaded directly into ArcGIS Runtime.

How to use the sample

Pan and zoom around the map to observe the data from the shapefile.

How it works

  1. Create a ShapefileFeatureTable passing in the URL of a shapefile.
  2. Create a FeatureLayer using the shapefile feature table.
  3. Add the layer to the map's operation layers.

Relevant API

  • FeatureLayer
  • ShapefileFeatureTable

Offline data

This sample downloads the following items from ArcGIS Online automatically:

  • Public Art Shapefile - Shapefiles that cover Aurora Colorado: Public art (points), Bike trails (lines), and Subdivisions (polygons).

Tags

layers, shapefile, shp, vector

Sample Code

FeatureLayerShapefile.xamlFeatureLayerShapefile.xamlFeatureLayerShapefile.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
<UserControl
    x:Class="ArcGIS.UWP.Samples.FeatureLayerShapefile.FeatureLayerShapefile"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls" >
    <esriUI:MapView x:Name="MyMapView" />
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.