Read a GeoPackage

This sample demonstrates how to open a GeoPackage file from the local file system and list the available GeoPackageRasters and GeoPackageFeatureTables from the GeoPackage. Users can add and remove the selected datasets as RasterLayers or FeatureLayers to the map.

Read layers from a GeoPackage


Select a layer name in the Layers Not in the Map list and then click the Add Layer to Map button to add it to the map. Conversely to remove a layer from the map select a layer name in the Layers Not in the Map list and click the Remove Layer from Map button.


The GeoPackage will be downloaded from an ArcGIS Online portal automatically.


<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
            <RowDefinition Height="20"/>
            <RowDefinition Height="100" />
            <RowDefinition Height="20" />
            <RowDefinition Height="100"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*" />
        <Label Grid.Row="0">Layers in the Map</Label>
        <ListView Grid.Row="1" x:Name="ListView_LayersInTheMap" />
        <Label Grid.Row="2">Layers Not in the Map</Label>
        <ListView Grid.Row="3" x:Name="ListView_LayersNotInTheMap" />
        <Button Grid.Row="4" x:Name="Button_AddLayerToMap" Text="Add layer to map" Clicked="Button_AddLayerToMap_Clicked"/>
        <Button Grid.Row="5" x:Name="Button_RemoveLayerFromMap" Text="Remove layer from map" Clicked="Button_RemoveLayerFromMap_Clicked"/>
        <esriUI:MapView Grid.Row="6" x:Name="MyMapView" />

In this topic
  1. Instructions
  2. Code