Select ENC features
Select features in an ENC layer.
You can use selection to identify a feature and learn more about it. ENC layers often have many overlapping features, and features of mixed geometry, in a single layer, so the sample includes code for identifying the smallest feature, which is taken to be the most relevant.
Tap to select ENC features. Feature properties will be displayed in a callout.
- Load and display the ENC layer.
- When the map view is tapped, call
mapView.IdentifyLayersAsync(), specifying the tapped position, a tolerance, and false for the
- Filter the list of identified layers to include only results where the
- Get the first result with at least one feature.
- Get the first feature in the
- Select that feature by calling
- Show the feature's acronym and description in a callout.
This sample downloads the following items from ArcGIS Online automatically:
The sample uses ENC Exchange Set without updates a mock ENC data set, available on ArcGIS Online.
chart, hydrography, identify, IHO, maritime, S-57, S57, select, selection
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms" xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" x:Class="ArcGISRuntime.Samples.SelectEncFeatures.SelectEncFeatures"> <Grid> <esriUI:MapView x:Name="MyMapView"/> </Grid> </ContentPage>