ArcGISMap

A map is a container for layers. Use a map together with a MapView to display layers of geographic data in 2D. ArcGISMap contains layers of mapping data and information such as basemaps, popups, renderers, and labels which define the map's capabilities. You can access ArcGISMap content directly or visualize the map in a MapView.

In an MVC architecture, ArcGISMap represents the model and MapView represents the view. ArcGISMap specifies how the geographic data is organized, and MapView renders the data on the screen and allows users to interact with it.

A map can contain a basemap and one or more operational layers:

  • A basemap is a map layer that helps orient the user of the map. Typically it sits behind operational layers and shows roads and parcel boundaries to give context to operational layers. Basemaps can also contain layers which are drawn over the top operational layers such as label layers.

  • An operational layer provides content that is of unique interest to the app and the task at hand, such as data about earthquakes, traffic, or weather. Its content might change frequently.

You can create a map from an existing web map using its URL or PortalItem. Alternatively, you can get a map directly from a MobileMapPackage.maps collection. ArcGISMap properties will be hydrated when the map is loaded.

If you create a new map, the spatial reference of the first layer you add, which is typically the first layer in the Basemap, defines the spatial reference of the entire map,

See Maps 2D[https://developers.arcgis.com/documentation/mapping-apis-and-services/maps/maps-2d/] for more information about maps.

Since

200.1.0

See also

Constructors

Link copied to clipboard
constructor(basemap: Basemap)

Creates a map with a Basemap.

constructor(basemapStyle: BasemapStyle)

Creates a map with a BasemapStyle.

constructor(item: Item)

Creates a map with a portal item of type PortalItemType.WebMap. The PortalItem automatically loads when the ArcGISMap loads. If the loaded Item is not a portal item of type PortalItemType.WebMap, the map fails to load.

constructor(spatialReference: SpatialReference? = null)

Creates a map with the specified spatial reference.

constructor(uri: String)

Creates a map with the URL to a web map. If the specified URL is a portal item URL, the underlying PortalItem is created and can be accessed through ArcGISMap.item. The URL can be a URL to web map JSON content or the URL of a portal item.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The background color of the map. This value specifies the color to be displayed behind the map. This color will be displayed in transparent areas of the map and areas where there is no basemap or operational data.

Link copied to clipboard

The information needed to create an IndoorsLocationDataSource. For a map to be IPS-aware, one of the following must be true:

Link copied to clipboard

The extent that constrains the display to a specific region. The max extent is initialized when the map loads or when you set it explicitly. This value limits panning in the MapView to a specific area of the map.

Link copied to clipboard

The maximum scale for the map. A value of zero indicates that there is no maximum scale and the user can zoom in indefinitely. The default value is 0.0.

Link copied to clipboard

The minimum scale for the map. A value of zero indicates that there is no minimum scale and the user can zoom out indefinitely. The default value is 0.0.

Link copied to clipboard

Offline settings configured by the author of an online web map (if appropriate). Offline settings optimize the data that is delivered during download and synchronization. For example, they can control feature and attachment delivery or define whether the map's basemap is created using a tile package already on the device.

Link copied to clipboard

The reference scale for the map. The reference scale is the scale at which feature symbols and text will appear at their authored size. If the viewing scale is different from the reference scale, then the symbology and text graphics will be scaled to keep the same size on the map. Only those layers for which scaleSymbols is true will be scaled. For example, FeatureLayer.scaleSymbols.

Link copied to clipboard

Unknown data from the source JSON. Unknown JSON is a dictionary of values that was in the source JSON but was unparsed by this API.

Link copied to clipboard

Unsupported data from the source JSON. Unsupported JSON is a dictionary of values that are supported by web maps, but not exposed through this API.

Link copied to clipboard
val uri: String?

The URI for the map.

Link copied to clipboard

The utility networks in the map. This collection of UtilityNetwork is specific to this map.

Inherited properties

Link copied to clipboard
val basemap: StateFlow<Basemap?>

Optional layers in a map or scene that show background information—roads, landmarks, and so on—to help orient the user of the map or scene. Typically image tile or vector tile layer types. Basemaps can be composed of different layers organized in Basemap.baseLayers (displayed beneath other layers) and Basemap.referenceLayers (displayed on top of other layers). You can use ready-to-use basemaps, style your own with the ArcGIS Vector Tile Style Editor, or create and publish your own with ArcGIS Pro.

Link copied to clipboard

The collection of bookmarks defined for this map or scene. Bookmarks allow users to quickly navigate to a particular area of interest in a map or scene.

Link copied to clipboard

Defines the properties that allow a map or a scene to be floor-aware. Floor-aware maps and scenes contain data representing floor plan and indoor features. The data displayed by floor-aware maps and scenes can be filtered based on floor levels using the FloorManager. This property is null for maps or scenes that are not floor-aware.

Link copied to clipboard

Manages the data displayed for a floor-aware map or scene, allowing filtering based on floor levels. A FloorManager must be loaded before you can access its site, facility, and level properties, and perform floor filtering.

Link copied to clipboard

Information about the set of Geotrigger objects defined for the map or scene. You must load the GeotriggersInfo to populate the collection with any geotriggers defined by the author of the map or scene. If no geotriggers are defined this list will remain empty.

Link copied to clipboard

The initial viewpoint when the map or scene is first displayed. The initial viewpoint value is available when the map or scene is loaded. If you want to change the initial viewpoint, you can do this before you add the map or scene to a GeoView. At this point, the GeoView's viewpoint is set to this initial viewpoint. Any subsequent changes to the GeoModel.initialViewpoint are ignored.

Link copied to clipboard
var item: Item?

The ArcGIS item associated with this map or scene. This can be a PortalItem (for web maps and web scenes loaded from a portal or saved to a portal), or a LocalItem (for maps in a map package or scenes in a scene package), or null if no Item is associated with this map or scene.

Link copied to clipboard

The properties that control the default loading and rendering behavior of feature layers in this map or scene. For example, you can specify which tiling mode should be used when feature layers are added, or specify whether feature tables should use advanced symbology.

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

The load status.

Link copied to clipboard

A collection of layers that can access geographic data from a file or a service. The operational layers collection is used to display geographic data layers on top of a basemap layer in an ArcGISMap or ArcGISScene. For example, you can display a fleet of vehicles being tracked on a map or display a point cloud layer of a tree canopy in a scene.

Link copied to clipboard

The spatial reference for this map or scene. SpatialReference specifies how geometry coordinates relate to real-world space. It ensures that you can accurately view, query, and analyze the layers of a map or scene.

Link copied to clipboard

A collection of feature tables in the map or scene. Unlike GeoModel.operationalLayers, tables are not displayed by the GeoView. The collection of feature tables is specific to the map or scene. You can add and remove tables by adding or removing them from the collection.

Link copied to clipboard

A collection of transportation network datasets defined for the map or scene. Map and scene authors can use ArcGIS Pro to create mobile map or scene packages that include transportation networks. If the map or scene is created from one of these packages, this collection will be populated with a read-only collection of TransportationNetworkDataset objects.

Link copied to clipboard

The version of the ArcGISMap or ArcGISScene when it is loaded. The version of a newly created ArcGISMap or ArcGISScene is empty. When you load an existing map or scene, the version value is the version that it was created at, according to the [ESRI web map specification[https://developers.arcgis.com/web-map-specification/] or https://developers.arcgis.com/web-scene-specification/, respectively.

Functions

Link copied to clipboard
open override fun clone(): ArcGISMap

Clones the ArcGISMap.

Returns a collection of all the UtilityNamedTraceConfiguration objects referenced by UtilityNetwork's map. An empty collection is returned if the UtilityNetwork does not belong to the map or if the map does not contain any UtilityNamedTraceConfiguration objects.

Link copied to clipboard
suspend fun save(forceSaveToSupportedVersion: Boolean): Result<Unit>

Saves this map back to the item it originated from.

Link copied to clipboard
suspend fun saveAs(portal: Portal, folder: PortalFolder?, title: String, description: String, tags: Iterable<String>, thumbnail: BitmapDrawable?, forceSaveToSupportedVersion: Boolean): Result<Unit>

Saves this map as a new web map on the specified portal with the given title in the given folder.

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 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.

Link copied to clipboard
fun setBasemap(basemap: Basemap?)

Optional layers in a map or scene that show background information — roads, landmarks, and so on — to help orient the user of the map or scene. Typically image tile or vector tile layer types. Basemaps can be composed of different layers organized in Basemap.baseLayers (displayed beneath other layers) and {@link Basemap.referenceLayers (displayed on top of other layers). You can use ready-to-use basemaps, style your own with the ArcGIS Vector Tile Style Editor, or create and publish your own with ArcGIS Pro.

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.