Class FeatureLayer
A layer that can visualize feature data.
Implements
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class FeatureLayer : Layer, INotifyPropertyChanged, ILoadable, ILayerContent, IPopupSource, ITimeAware, IFloorAware, ISnapSource, IFeatureFormSource
Remarks
Feature layers can display Feature data from a range of online feature table sources, such as ServiceFeatureTable, WfsFeatureTable, or OgcFeatureCollectionTable, and offline sources such as GeodatabaseFeatureTable, ShapefileFeatureTable, or GeoPackageFeatureTable. You can construct a feature layer object using these feature table sources or you can obtain it directly from a map or scene's collection of OperationalLayers.
Feature layers can also be used to store features associated with a utility network. To display features in a FeatureCollectionTable, use FeatureCollectionLayer instead.
Feature layers can be used to display, select, and query features in a layer. Individual features can be queried and filtered based on spatial queries or SQL queries. String comparisons for features queried in service feature tables are case insensitive.
If the underlying feature service or table supports editing, you can use it with a feature layer as a basis for editing geometry, attributes, and attachments.
The features in a feature layer are retrieved as needed by the app. Features can be downloaded from a sync-enabled feature service when the device is connected and cached locally for use when the device is offline. Edits can then be synchronized back to the service.
Functional characteristics
The following are sources that can be rendered using a feature layer.
Feature service - Backed by a ServiceFeatureTable; feature data from the service is cached locally in the table. New features are retrieved automatically when you navigate the map. The local table cache is discarded when the layer is disposed. If sync is enabled, features can be created, edited, and synchronized back to the server.
Geodatabase — Backed by a GeodatabaseFeatureTable; The geodatabase can be a replica of a
feature service, which allows synchronizing with a feature service, or taking the content of
a feature service offline. Use a
Shapefile — Backed by a ShapefileFeatureTable; use a feature layer to show the contents of a shapefile (.shp).
Geopackage — Backed by a GeoPackageFeatureTable; use a feature layer to render the tables in a GeoPackage (.gpkg). A GeoPackage is a data source that conforms to the OGC GeoPackage specification. Geopackage feature tables can be edited and saved, but do not support sync, because there is no backing feature service. This API supports GeoPackage versions 1.0, 1.1, and 1.2.
Web Feature Service (WFS) — Backed by a WfsFeatureTable. You can populate the table using QueryParameters or raw XML-encoded GetFeature queries. A WFS feature table only supports manual cache feature request mode. This API supports OGC WFS versions 2.0.0 and 2.0.2. WFS server implementations are inconsistent in how they expect coordinates to be formatted. Some return and expect coordinates in (x, y) order, while others expect (y, x). This API anticipates the order but you can configure it with the AxisOrder and FilterAxisOrder.
OGC API Features - Backed by an OgcFeatureCollectionTable. You can populate the table using Runtime query parameters. An OCG feature collection table only supports manual cache feature request mode. Runtime supports OGC API - Features - Part 1 and OGC API - Features - Part 2.
The features displayed in a FeatureLayer are automatically projected to match the map or scene's SpatialReference, if necessary. Local tables cannot be projected automatically.
FeatureLayer does not expose every value defined in the web map or web scene specification. You can obtain a dictionary of unsupported values from UnsupportedJson. The FeatureLayer also provides UnknownJson to return JSON that is not recognized in the web map or web scene specification.
Performance characteristics
The feature layer offers excellent display performance when zooming and panning the map within the extent of locally cached features. This is because features are drawn natively and full feature information is cached locally in a geodatabase, shapefile, or GeoPackage. Querying features is also efficient, enabling app functions such as real-time updates of query results in a map.
Initially, a local cache must be created. The initial download to the device may require extensive network usage and subsequent local device storage. App memory usage increases with the number and complexity of the features cached. You can eliminate the network usage by provisioning the cache directly to the device in advance
If the feature layer's FeatureTable is backed by a service, it has three feature request modes (FeatureRequestMode) that control how and when features are requested from the service:
- On interaction cache — Features are requested automatically for the visible map or scene extent. As the user pans and zooms, features are cached locally. If the user returns to an area where features have already been loaded, the table won't need to download those features again.
- Manual cache — Features are manually populated using a call to the PopulateFromServiceAsync(QueryParameters, Boolean, IEnumerable<String>) method. Once populated, all queries are made against the local table only. This method can be called again to retrieve more features from the service.
- On interaction, no cache—Features are requested automatically for the visible map extent. As the user pans and zooms, features outside the visible extent are not cached and must be downloaded again each time.
Constructors
Name | Description |
---|---|
FeatureLayer(FeatureTable) | Initializes a new instance of the FeatureLayer class from a given FeatureTable. |
FeatureLayer(Item) | Initializes a new instance of the FeatureLayer class from a feature layer or feature service portal item. |
FeatureLayer(Item, Int64) | Initializes a new instance of the FeatureLayer class from a portal item of type FeatureService. |
FeatureLayer(Uri) | Initializes a new instance of the FeatureLayer class with a ServiceFeatureTable. |
Properties
Name | Description |
---|---|
DefinitionExpression | Gets or sets a SQL expression which limits the features available for query and display on the feature layer. |
DisplayFilterDefinition | Gets or sets the value that defines how features are filtered from the display. |
FeatureFormDefinition | Gets the user interface to display when editing a feature in this layer. |
FeatureReduction | Gets or sets the properties for dynamically aggregating and summarizing groups of features as the map scale or visible extent changes. |
FeatureTable | Gets or sets the FeatureTable whose features are drawn on the map by this layer. |
FloorDefinition | Gets or sets the properties that allow a feature layer to be floor-aware. |
FullTimeExtent | Gets the temporal window that encapsulates the instance's complete set of data |
IsPopupEnabled | Gets or sets a value indicating whether the PopupDefinition defined is enabled. |
IsTimeFilteringEnabled | Gets or sets a value indicating whether the instance respects any temporal filters that are applied to it. |
LabelDefinitions | Gets a modifiable collection of LabelDefinition objects that define how labels are displayed. |
LabelsEnabled | Gets or sets a value indicating whether labels should be displayed. |
PopupDefinition | Gets or sets the pop-up definition for the FeatureLayer. |
RefreshInterval | Gets or sets the refresh interval on a FeatureLayer. |
Renderer | Gets or sets the renderer that specifies how the features are symbolized. |
RenderingMode | Gets or sets a value indicating how the feature layer is rendered. |
ScaleSymbols | Gets or sets a value indicating whether the layer's symbols and labels honor the Map reference scale. |
SceneProperties | Gets or sets the scene properties that are applied when the layer is rendered in a 3D scene using a scene view object. |
SupportsTimeFiltering | Gets a value indicating whether the instance supports filtering its data based on time. |
TilingMode | Gets or sets the mode defines whether feature tiling is used to retrieve the features from the feature service. |
TimeInterval | Gets a temporal value that represents the suggested temporal interval to use when sequentially stepping through the instance's data by time |
TimeOffset | Gets or sets the amount of time by which to offset the temporal values of data points in this instance when displaying the data in a GeoView. |
UnknownJson | Gets unknown data from the source JSON. |
UnsupportedJson | Gets unsupported data from the source JSON. |
Methods
Name | Description |
---|---|
ClearSelection() | Clears all selected features. |
GetSelectedFeaturesAsync() | Returns a list of the currently selected features. |
ResetFeaturesVisible() | Resets the visibility of all features back to their original state. |
ResetRenderer() | Resets the renderer back to the original renderer provided by the FeatureTable. |
SelectFeature(Feature) | Selects the given feature and adds it to the current list of selected features. |
SelectFeatures(IEnumerable<Feature>) | Selects the features in the list and adds them to the current list of selected features. |
SelectFeaturesAsync(QueryParameters, SelectionMode) | Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features GetSelectedFeaturesAsync(). |
SelectFeaturesAsync(QueryParameters, SelectionMode, CancellationToken) | Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features GetSelectedFeaturesAsync(). |
SetFeaturesVisible(IEnumerable<Feature>, Boolean) | Sets the visibility of the given features. |
SetFeatureVisible(Feature, Boolean) | Sets the visibility of the given feature. |
UnselectFeature(Feature) | Unselects the given feature and removes it from the current list of selected features. |
UnselectFeatures(IEnumerable<Feature>) | Unselects the given features and removes them from the current list of selected features. |
Events
Name | Description |
---|---|
FullTimeExtentChanged | Raised when the FullTimeExtent of the instance's data changes |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.0 - 200.6 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.6 |