Add, remove, and reorder operational layers in a map.
Operational layers display the primary content of the map and usually provide dynamic content for the user to interact with (as opposed to basemap layers that provide context).
The order of operational layers in a map determines the visual hierarchy of layers in the view. You can bring attention to a specific layer by rendering it above other layers.
When the app starts, the display lists of operational layers and any removed layers. Tap the up/down buttons to change its position, or the visibility button to add it from the map. Tap removed layers to add them back to the map. The map will be updated automatically.
- Get the operational layers
MutableList<Layer>
from the map usingmap.operationalLayers
. - Add or remove layers using
mutableLayerList.add(layer)
andlayerList.remove(layer)
respectively. The last layer in the list will be rendered on top.
- ArcGISMap
- ArcGISMapImageLayer
- LayerList
This sample uses the GeoViewCompose Toolkit module to be able to implement a Composable MapView.
You cannot add the same layer to the map multiple times or add the same layer to multiple maps. Instead, clone the layer with layer.clone()
before duplicating.
add, delete, geoviewcompose, layer, map, remove, toolkit