Delete features from an online feature service.
Use case
Sometimes users may want to delete features from an online feature service.
How to use the sample
To delete a feature, tap it, then click 'Delete incident'.
How it works
- Create a
ServiceFeatureTable
object from a URL. - Create a
FeatureLayer
object from the service feature table. - Select features from the feature layer via
FeatureLayer.SelectFeatures()
. - Remove the selected features from the service feature table using
ServiceFeatureTable.DeleteFeatureAsync()
. - Update the table on the server using
ServiceFeatureTable.ApplyEditsAsync()
.
Relevant API
- Feature
- FeatureLayer
- ServiceFeatureTable
Tags
deletion, feature, online, Service, table
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.DeleteFeatures.DeleteFeatures"
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">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
<Border Style="{StaticResource BorderStyle}">
<TextBlock Text="Tap a feature to select it for deletion."
TextAlignment="Center" FontWeight="SemiBold" />
</Border>
</Grid>
</UserControl>