Class FeatureLayer
A layer that can visualize vector/feature data.
Implements
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class FeatureLayer : Layer, INotifyPropertyChanged, ILoadable, ILayerContent, IPopupSource, ITimeAware, IFloorAware
Remarks
Feature layers displays feature data from the online sources: ServiceFeatureTable, OgcFeatureCollectionTable, and WfsFeatureTable and from the offline sources: GeodatabaseFeatureTable,ShapefileFeatureTable, and GeoPackageFeatureTable. Feature layers can be used to display, select, and query features in a layer. 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. Feature layers can also be used to store features associated with a utility network.
To display features in a FeatureCollectionTable, use FeatureCollectionLayer instead.
Features 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 service feature table; 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 pushed to the server.
Geodatabase — Backed by a geodatabase feature table; 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 geodatabase sync task to synchronize the geodatabase with the service. The geodatabase can also be a mobile geodatabase created by ArcGIS Pro. Mobile geodatabases cannot be synced and use a default renderer.
Shapefile — Backed by a shapefile feature table; use a feature layer to show the contents of shapefiles (.shp).
Geopackage — Backed by a geopackage feature table; 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 can't support sync, because there is no backing feature service. ArcGIS Runtime supports GeoPackage versions 1.0, 1.1, and 1.2.
Web Feature Service (WFS) — Backed by a WFS feature table. You can populate the table using Runtime query parameters or raw XML-encoded GetFeature queries. A WFS feature table only supports manual cache feature request mode. Runtime 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). Runtime guesses the correct order by default. This behavior can be configured with the AxisOrder and FilterAxisOrder properties.
OGC API Features - Backed by an OGC feature collection table. 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.
Individual features can be queried and filtered based on spatial queries or SQL queries. Starting with release 100.3.0, ArcGIS Runtime uses case-insensitive string comparison when querying a ShapefileFeatureTable.
The features displayed in a FeatureLayer are re-projected to match the SpatialReference, if necessary. Local tables cannot be re-projected automatically.
Feature layers expose a UnsupportedJson property that, for feature layers based on a feature service, returns a dictionary of values known to the supported web map specification but not explicitly exposed through the Runtime API. This allows you to access information that was saved with the layer but not used b Runtime. Feature layers also provide a UnknownJson property to return JSON that was not recognized.
Performance characteristics
As full feature information is cached locally in a geodatabase, shapefile, or GeoPackage, and features are drawn natively, this layer type offers excellent display performance when zooming and panning the map within the extent of cached features. Querying features is also efficient, enabling app functions such as real-time updates of query results in a map.
The local cache must be initially created, which can be resource-intensive for the server. The initial download to the device may require extensive network usage and subsequent local device storage. App memory increases with the number and complexity of the features cached. Network usage can be eliminated by provisioning the cache directly to the device in advance.
Feature tables backed by a service define three feature request modes. The table's feature request mode controls 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 must be 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. |
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. |
FeatureTable | Gets or sets the FeatureTable associated with 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 label definitions for this feature layer. |
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 used for rendering features on this layer. |
RenderingMode | Gets or sets a value indicating which rendering mode to use |
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 for the feature layer. |
SupportsTimeFiltering | Gets a value indicating whether the instance supports filtering its data based on time. |
TilingMode | Gets or sets the feature tiling mode in use by the feature layer. Default is EnabledWhenSupported. |
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 layer's features visibility back to factory defaults. |
ResetRenderer() | Resets the renderer to the factory default. |
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 features in the given list 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 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.15 |