Layer

sealed class Layer : LayerContent, Loadable

A base class for classes that represent layers. A layer, also known as an operational layer, provides access to geographic data that is displayed in a map or scene. Each layer references a file or service data source that contains either vector data (points, lines, polygons and attributes) or raster data (images). The ArcGISMap or ArcGISScene can display these layers inside a MapView or SceneView, respectively. To enhance the displayed information, you can 'stack' the layers into a collection of ArcGISMap.operationalLayers or ArcGISScene.operationalLayers. The first layer in the collection is drawn first (on the bottom) and each subsequent layer is drawn on top of it.

Layer is the base class for these different types of layers:

Layer type 2D/3D Time-aware Online/offline Sources
Annotation layer ([AnnotationLayer]) 2D No Both ArcGIS feature service, portal item, mobile map package (.mmpk)
ArcGIS map image layer ([ArcGISMapImageLayer]) Both Yes Online ArcGIS map service
ArcGIS scene layer ([ArcGISSceneLayer]) 3D No Both Scene service or scene package
ArcGIS tiled layer ([ArcGISTiledLayer]) Both No Both ArcGIS tile service, tile package (.tpk/.tpkx)
ArcGIS vector tiled layer ([ArcGISVectorTiledLayer]) Both No Both ArcGIS vector tile service, vector tile package (.vtpk)
Bing maps layer ([BingMapsLayer]) Both No Online Bing maps
Dimension layer ([DimensionLayer]) 2D Yes Offline Mobile map package (.mmpk)
Dynamic entity layer ([DynamicEntityLayer]) Both No Online ArcGIS stream service
ENC layer ([EncLayer]) 2D No Offline ENC exchange set, ENC cell
Feature collection layer ([FeatureCollectionLayer]) Both No Both Portal item, web map, feature set / query result
Feature layer ([FeatureLayer]) Both Yes Both ArcGIS feature service, WFS, shapefile, GeoPackage, geodatabase, OGC API Features
Group layer ([GroupLayer]) Both No Both Other layers and group layers
KML layer ([KmlLayer]) Both Yes Both KML file (.kml, .kmz)
Integrated mesh layer ([IntegratedMeshLayer]) 3D No Both Scene layer package (.slpk)
Mobile basemap layer ([MobileBasemapLayer]) 2D No Offline Mobile map package (.mmpk)
OGC 3D Tiles layer ([Ogc3DTilesLayer]) 3D No Both Portal item, tileset, tile package(.3tz)
OpenStreetMap layer ([OpenStreetMapLayer]) Both No Online OpenStreetMap.org
Point cloud layer ([PointCloudLayer]) 3D No Both Portal item, scene layer package (.slpk)
Raster layer ([RasterLayer]) Both Yes Both GeoPackage, raster file, ArcGIS Image service
Subtype feature layer ([SubtypeFeatureLayer]) 2D No Both ArcGIS feature service, geodatabase
Web tiled layer ([WebTiledLayer]) Both No Online Web tile service
WMS layer ([WmsLayer]) Both Yes Online WMS service
WMTS layer ([WmtsLayer]) Both No Online WMTS service

Since

200.1.0

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The attribution text for the layer.

Link copied to clipboard

The description for the layer.

Link copied to clipboard

The full extent of this layer, which is the extent where all layer data is contained. You can use this to zoom to all of the data contained in this layer. For feature layers, the extent is retrieved from its FeatureTable.extent.

Link copied to clipboard
var id: String

The unique identifying string for the layer, as specified in a map or scene. The id is used by other parts of this API to refer to a specific Layer, such as in a set of FeatureFenceParameters or a FacilityLayerDefinition. If not supplied, all layers will be assigned a unique id when created.

Link copied to clipboard

True if the layer supports identify, false otherwise. The value of this property may not be correct until the layer is in a fully loaded state.

Link copied to clipboard
val item: Item?

The item the layer has been created from.

Link copied to clipboard

The maximum scale for the layer. The maximum scale at which this layer is visible. If the map or scene is zoomed in beyond this scale, the layer will not be visible. A value of 0 means there is no maximum scale threshold and the layer will be visible at the smallest scale available for the map or scene. If the value is nil, there is no maximum scale. All of the connected map and scene views will be updated.

Link copied to clipboard

The minimum scale for the layer. The minimum scale at which this layer is visible. If the map or scene is zoomed out beyond this scale, the layer will not be visible. A value of 0 means there is no minimum scale threshold and the layer will be visible at the largest scale available for the map or scene. If the value is nil, there is no minimum scale. All of the connected map and scene views will be updated.

Link copied to clipboard
open override var name: String

The name of this layer.

Link copied to clipboard

The opacity for the layer. The opacity of this layer as a value between 0 (fully transparent) and 1 (fully opaque). The default opacity value is 1.

Link copied to clipboard

The spatial reference of the layer.

Link copied to clipboard
val visibilityChanged: SharedFlow<Boolean>

Callback invoked when the visibility of the layer changes.

Inherited properties

Link copied to clipboard
open override val canChangeVisibility: Boolean

A flag indicating whether the layer content's visibility can be changed. A flag indicating whether the layer content visibility can be changed. Will return false if an error occurs.

Link copied to clipboard
open override var isVisible: Boolean

The layer content's visibility. The layer content visibility. Will return false if an error occurs.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Link copied to clipboard
open override var showInLegend: Boolean

A flag indicating whether the layer content participates in the legend. A flag indicating whether the layer content is shown in the legend.

Link copied to clipboard
open override val subLayerContents: StateFlow<List<LayerContent>>

The sub layer contents of a layer content.

Functions

Link copied to clipboard
abstract fun clone(): Layer

Clones this instance of the layer and its members.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open suspend override fun fetchLegendInfos(): Result<List<LegendInfo>>

Fetches the list of legend info.

Link copied to clipboard
open override fun isVisibleAtScale(scale: Double): Boolean

Returns the layer content's effective visibility at the specified scale. Returns the effective layer content visibility. This effective visibility takes care of the effective visibility of the parents at the specified scale. Will return false if an error occurs.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.