Basemap

A basemap is a non-editable layer that provides background, or reference information, in your map or scene. A basemap provides a background of geographical context for the content you display in a map or scene. It provides a visual reference to help orient users and a framework on which you can overlay operational layers, perform analysis, and visualize geographic information. The content of a basemap is typically static and does not change frequently.

A basemap is composed of a collection of base layers (Basemap.baseLayers) and reference layers (Basemap.referenceLayers). Base layers are displayed at the bottom of a map or scene, and reference layers are displayed at the top, with the GeoModel.operationalLayers between them.

Typically, you construct a basemap using a basemap style:

  • Use image tile basemap styles for satellite imagery and hillshade.

  • Use vector tile basemap styles such as streets navigation, light gray canvas, and OpenStreetMap (OSM).

  • Create custom basemap styles with your own colors, glyphs, and fonts using the https://developers.arcgis.com/documentation/mapping-apis-and-services/tools/vector-tile-style-editor/.

See BasemapStyle for the full range of the basemap styles provided by Esri. Basemap styles allow you to take advantage of geographically load-balanced services and monitor usage with API keys or named users. See Basemap layers[https://developers.arcgis.com/documentation/mapping-apis-and-services/maps/basemap-layers/] for more information.

If your app works offline, you can construct a local basemap from a tiled layer using a TileCache, such as a tile package (.tpk, .tpkx, .vtpk) or a compact cache, stored on the device.

Since

200.1.0

See also

Basemap.Basemap

()

Constructors

Link copied to clipboard
constructor(item: Item)

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

constructor(baseLayer: Layer)

Creates a basemap with a single base layer.

constructor(baseLayers: Iterable<Layer> = listOf(), referenceLayers: Iterable<Layer> = listOf())

Creates a basemap with collections of base and reference layers.

constructor(uri: String)

Creates a basemap with the URI. If the specified URI is a portal item URL (see PortalItem.PortalItem(String) for the supported URL formats), the underlying PortalItem will be created and accessible through Basemap.item.

constructor(basemapStyle: BasemapStyle, basemapStyleParameters: BasemapStyleParameters? = null)

Creates a basemap from an initial BasemapStyle with optional BasemapStyleParameters to control settings such as language. These basemaps are secured and access requires either an API key or an authenticated user.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The collection of base layers in this basemap. Base layers are drawn beneath all other layers in the ArcGISMap or ArcGISScene. They are designed to provide a visual reference to help orient the user. Aerial imagery, terrain, and streets are examples of basemap layers. The collection can be empty but it is never null.

Link copied to clipboard
val item: Item?

The portal item associated with this basemap.

Link copied to clipboard

The name of this basemap.

Link copied to clipboard

The collection of reference layers in this basemap. Reference layers are drawn on top all other layers in the ArcGISMap or ArcGISScene to display information such as boundaries, labels, and traffic networks. The collection can be empty but it is never null.

Link copied to clipboard
val uri: String?

The URI of this basemap.

Inherited properties

Link copied to clipboard
open override var apiKey: ApiKey?

The API key allows your app to access ArcGIS location services and private portal items. An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items. You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.

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

The load status.

Functions

Link copied to clipboard
fun clone(): Basemap

Clones this instance of Basemap and its members. All objects referenced by the basemap, such as layers or portal item, are copied as well.

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
open override fun toJson(): String

Convert an object to JSON string.