UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

535 lines (533 loc) • 32.5 kB
import type Basemap from "./Basemap.js"; import type Ground from "./Ground.js"; import type Layer from "./layers/Layer.js"; import type FocusAreas from "./effects/FocusAreas.js"; import type { BasemapProperties } from "./Basemap.js"; import type { GroundProperties } from "./Ground.js"; import type { ReadonlyCollection } from "./core/Collection.js"; import type { EventedAccessor } from "./core/Evented.js"; import type { EditableLayerUnion } from "./layers/types.js"; import type { LayersMixin, LayersMixinProperties } from "./support/LayersMixin.js"; import type { TablesMixin, TablesMixinProperties } from "./support/TablesMixin.js"; import type { FocusAreasProperties } from "./effects/FocusAreas.js"; export interface MapProperties extends LayersMixinProperties, TablesMixinProperties { /** * Specifies a basemap for the map. The basemap is a set of layers that give * geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and the other [operational layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers) * in the map. * * The basemap can be created in a variety of ways: * 1. From the **[basemap styles service (v2)](https://developers.arcgis.com/javascript/latest/references/core/support/BasemapStyle/)** * 2. From an instance of the **[Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) class** * 3. From a **[basemap id](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap-id)** * * > [!WARNING] * > * > Use of these basemaps requires either an [ArcGIS Location Platform](https://location.arcgis.com/) account, [ArcGIS Online organizational](https://doc.arcgis.com/en/arcgis-online/get-started/create-account.htm#ESRI_SECTION1_24871ED982AC41ED86FF1937E7604CDE) subscription, or an [ArcGIS Enterprise license](https://enterprise.arcgis.com/en/). * > * > To authenticate basemap requests, you may need an access token. You can use an [API key](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/) or [OAuth 2.0](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2/). When using an API key, the key must have [privileges](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/#available-services) to access the appropriate location service. * * <span id="basemap-id"></span> * #### Basemap Id * * ##### Basemap Styles * * _Since version 4.28_ * * Basemaps from the Basemap Styles service can be accessed using the id of the basemap style, in form of `{provider}/{style}`, for example `arcgis/navigation`. See [Basemap styles -> Requests](https://developers.arcgis.com/rest/basemap-styles/#requests) for the full list of available styles. * * ```js * map.basemap = "arcgis/topographic"; // sets the basemap to the ArcGIS topographic style * ``` * * ##### 3D Basemaps * * _Since version 4.28_ * * The 3D Basemaps can be accessed using the basemap id in the table below. They are designed to be used as basemaps in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * Value | Source | * ------|------- | * `topo-3d` | [Topographic](https://www.arcgis.com/home/item.html?id=0560e29930dc4d5ebeb58c635c0909c9) | * `navigation-3d` | [Navigation](https://www.arcgis.com/home/item.html?id=00a5f468dda941d7bf0b51c144aae3f0) | * `navigation-dark-3d` | [Navigation (Dark)](https://www.arcgis.com/home/item.html?id=5a1365328b4943f09a54cf5fd1205707) | * `osm-3d` | [OpenStreetMap](https://www.arcgis.com/home/item.html?id=1c071fcf8ff2448599b0547116e2de55) | * `gray-3d` | [Light Gray Canvas](https://www.arcgis.com/home/item.html?id=35cdf329d663403b99df27d6ca5fa38d) | * `dark-gray-3d` | [Dark Gray Canvas](https://www.arcgis.com/home/item.html?id=a8b7322a5fe94002bb0f5e0eeb0c5c18) | * `streets-3d` | [Streets](https://www.arcgis.com/home/item.html?id=1754f80e7e6644e28ce0c4d35066e392) | * `streets-dark-3d` | [Streets (Dark)](https://www.arcgis.com/home/item.html?id=8a4efa2c20484ec9b4557895e65736ff) | * * > [!WARNING] * > * > **Known Limitations** * > * > 3D Basemaps can only be used in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * ##### 2D (legacy) * * _Since version 4.0_ * * The legacy basemaps can be accessed using the basemap id in the table below. These are references to [enhanced](https://developers.arcgis.com/documentation/mapping-apis-and-services/service-endpoints/#2-enhanced-endpoint) basemap endpoints. * * <details> * <summary>Read More</summary> * * Value | Source | * ------|------- | * `satellite` | [World Imagery](https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer) | * `hybrid` | [Hybrid Reference Layer](https://www.arcgis.com/home/item.html?id=30d6b8271e1849cd9c3042060001f425) and [World Imagery](https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer) | * `oceans` | [World Ocean Reference](https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer) and [World Ocean Base](https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer) | * `osm` | [OpenStreetMapLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OpenStreetMapLayer/) | * `terrain` | [World Reference Overlay](https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer) and [World Hillshade](https://services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer) | * `dark-gray` / `dark-gray-vector` | [Dark Gray Canvas](https://www.arcgis.com/home/item.html?id=c11ce4f7801740b2905eb03ddc963ac8) | * `gray` / `gray-vector` | [Light Gray Canvas](https://www.arcgis.com/home/item.html?id=8a2cba3b0ebf4140b7c0dc5ee149549a) | * `streets` / `streets-vector` | [World Street Map](https://www.arcgis.com/home/item.html?id=de26a3cf4cc9451298ea173c4b324736) | * `streets-night-vector` | [World Street Map (Night)](https://www.arcgis.com/home/item.html?id=86f556a2d1fd468181855a35e344567f) | * `streets-navigation-vector` | [World Navigation Map](https://www.arcgis.com/home/item.html?id=63c47b7177f946b49902c24129b87252) | * `topo` / `topo-vector` | [World Hillshade](https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer) and [World Topographic Map](https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5) | * `streets-relief-vector` | [World Hillshade](https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer) and [World Street Map (with Relief)](https://www.arcgis.com/home/item.html?id=b266e6d17fc345b498345613930fbd76) | * * </details> * * @example * // create the basemap from a string id representing the basemap style * const map = new Map({ * basemap: "arcgis/topographic" * }); * * // create the basemap from a BasemapStyle object * const map = new Map({ * basemap: { * style: { * id: "arcgis/outdoor", * language: "es" // place labels will be displayed in spanish * } * } * }); * @example * // Set the basemap from a string ID in the constructor * const map = new Map({ * basemap: "dark-gray-3d" * }); * * // Set the basemap after the map instance is created * map.basemap = "topo-3d"; * @example * // Create a VectorTileLayer from a style URL * const mapBaseLayer = new VectorTileLayer({ * url: "https://arcgis.com/sharing/rest/content/items/b5676525747f499687f12746441101ef/resources/styles/root.json" * }); * * // Create a Basemap with the VectorTileLayer * const customBasemap = new Basemap({ * baseLayers: [mapBaseLayer], * title: "Terrain" * }); * * // Set the basemap to the customBasemap * const map = new Map({ * basemap: customBasemap * }); */ basemap?: BasemapProperties | string | null; /** * A container of all [focus areas](https://developers.arcgis.com/javascript/latest/references/core/effects/FocusAreas/) present in the map. * * > [!WARNING] * > * > **Known Limitations** * > * > Focus areas are only supported in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * @see [FocusAreas](https://developers.arcgis.com/javascript/latest/references/core/effects/FocusAreas/) * @see [Sample - Focus Area](https://developers.arcgis.com/javascript/latest/sample-code/focus-area/) */ focusAreas?: FocusAreasProperties; /** * Specifies the surface properties for the map. In MapView, this property is used by the * [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/) when the * [profile](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/#profiles) contains an * [ElevationProfileLineGround](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLineGround/). * In 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), it renders the * terrain or topographical variations in the real world on the map's surface * with a collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/). * * This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/), or one of the following strings: * - `world-elevation` for a default instance of ground using the * [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). * - `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the * [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). * * The ground may not be set to `null` or `undefined`, it is guaranteed to always * contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/). The elevation can be removed from the ground * by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/) instance or by removing all * the ground layers. * * @see [ElevationLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/) * @see [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/) * @example * // Use the world elevation service * const map = new Map({ * basemap: "topo-vector", * ground: "world-elevation" * }); * @example * // Create a map with the world elevation layer overlaid by a custom elevation layer * const worldElevation = new ElevationLayer({ * url: "//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" * }); * const customElevation = new ElevationLayer({ * url: "https://my.server.com/arcgis/rest/service/MyElevationService/ImageServer" * }); * const map = new Map({ * basemap: "topo-vector", * ground: new Ground({ * layers: [ worldElevation, customElevation ] * }) * }); */ ground?: GroundProperties | string | null; } /** * The Map class contains properties and methods for storing, managing, and overlaying [layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers) * common to both 2D and 3D viewing. * Layers can be added and removed from the map, but are rendered via a * [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) (for viewing data in 2D) or a * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) (for viewing data in 3D). Thus a map instance is a simple container * that holds the layers, while the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/) is the means of displaying and * interacting with a map's layers and basemap. * * A single map may be referenced by multiple views. [This sample](https://developers.arcgis.com/javascript/latest/sample-code/views-synchronize/) * for example, contains a single Map that is visible in two separate views - one in [2D](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) * and the other in [3D](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Because one map may be accessed by multiple views * in the same application, all user interaction with a map's layers is handled on the * [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/), not the Map. * * An instance of Map is an essential component of the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) * and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). A Map object should be created prior to a * view so it can be passed into the `map` property of that view * (e.g. [MapView.map](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#map), [SceneView.map](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#map)). * * ```js * // Load the Map and MapView modules * const [Map, MapView] = await $arcgis.import(["@arcgis/core/Map.js", "@arcgis/core/views/MapView.js"]); * // Create a Map instance * const myMap = new Map({ * basemap: "streets-vector" * }); * // Create a MapView instance (for 2D viewing) and reference the map instance * const view = new MapView({ * map: myMap * }); * ``` * * @since 4.0 * @see [Sample - Intro to MapView](https://developers.arcgis.com/javascript/latest/sample-code/intro-mapview/) * @see [Sample - Intro to SceneView](https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/) * @see [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) * @see [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) */ export default class Map extends MapSuperclass { /** * @example * // Typical usage * const map = new Map({ * basemap: "topo-vector" * }); */ constructor(properties?: MapProperties); /** * A flattened collection of all [layers](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/) in the map. * This collection contains [basemap layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap), [operational layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers) * and [ground layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#ground). [Group Layers](https://developers.arcgis.com/javascript/latest/references/core/layers/GroupLayer/) and their * [children layers](https://developers.arcgis.com/javascript/latest/references/core/layers/GroupLayer/#layers) are also * part of this collection. Reference layers in the basemap will always be included * at the end of the collection. * * Layers should not be added directly to this collection. They must only be added via the * [layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers), [basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap) or [ground](https://developers.arcgis.com/javascript/latest/references/core/Map/#ground) properties. * * > [!WARNING] * > * > To access a flattened collection of tables, use the [allTables](https://developers.arcgis.com/javascript/latest/references/core/Map/#allTables) property instead. * * @example * // Find a layer with title "US Counties" * const foundLayer = map.allLayers.find(function(layer) { * return layer.title === "US Counties"; * }); * * // Create a filtered collection of the non-group layers * const nonGroupLayers = map.allLayers.filter(function(layer) { * return !foundLayer.layers; * }); * * // Listen for any layer being added or removed in the Map * map.allLayers.on("change", function(event) { * console.log("Layer added: ", event.added); * console.log("Layer removed: ", event.removed); * console.log("Layer moved: ", event.moved); * }); * * // Watching for changes to the visible layers in the Map * reactiveUtils.watch( * () => view.map.allLayers.filter((layer) => layer.visible), * (newVisibleLayers, oldVisibleLayers) => { * const added = newVisibleLayers.filter( * (layer) => !oldVisibleLayers.includes(layer) * ); * const removed = oldVisibleLayers.filter( * (layer) => !newVisibleLayers.includes(layer) * ); * added.forEach((layer) => console.log(layer.title, "is visible")); * removed.forEach((layer) => console.log(layer.title, "is not visible")); * } * ); */ get allLayers(): ReadonlyCollection<Layer>; /** * A flattened collection of tables anywhere in the map's hierarchy. This will contain * individual tables within the map's [tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables), in addition to any * [group layer tables](https://developers.arcgis.com/javascript/latest/references/core/layers/GroupLayer/#tables). In order for the * table(s) to be recognized as such, the [FeatureLayer.isTable](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#isTable) property * must return `true`. * * > [!WARNING] * > * > Currently, only [feature layer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) tables are recognized. * > To access spatial layers, use the [allLayers](https://developers.arcgis.com/javascript/latest/references/core/Map/#allLayers) property instead. * * @since 4.17 * @example * // A feature layer where isTable = true. * const foundTable = map.allTables.find(function(table) { * // Find a table with title "US Counties" * return table.title === "US Counties"; * }); */ get allTables(): ReadonlyCollection<Layer>; /** * Specifies a basemap for the map. The basemap is a set of layers that give * geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) and the other [operational layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers) * in the map. * * The basemap can be created in a variety of ways: * 1. From the **[basemap styles service (v2)](https://developers.arcgis.com/javascript/latest/references/core/support/BasemapStyle/)** * 2. From an instance of the **[Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) class** * 3. From a **[basemap id](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap-id)** * * > [!WARNING] * > * > Use of these basemaps requires either an [ArcGIS Location Platform](https://location.arcgis.com/) account, [ArcGIS Online organizational](https://doc.arcgis.com/en/arcgis-online/get-started/create-account.htm#ESRI_SECTION1_24871ED982AC41ED86FF1937E7604CDE) subscription, or an [ArcGIS Enterprise license](https://enterprise.arcgis.com/en/). * > * > To authenticate basemap requests, you may need an access token. You can use an [API key](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/) or [OAuth 2.0](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/oauth-2/). When using an API key, the key must have [privileges](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/#available-services) to access the appropriate location service. * * <span id="basemap-id"></span> * #### Basemap Id * * ##### Basemap Styles * * _Since version 4.28_ * * Basemaps from the Basemap Styles service can be accessed using the id of the basemap style, in form of `{provider}/{style}`, for example `arcgis/navigation`. See [Basemap styles -> Requests](https://developers.arcgis.com/rest/basemap-styles/#requests) for the full list of available styles. * * ```js * map.basemap = "arcgis/topographic"; // sets the basemap to the ArcGIS topographic style * ``` * * ##### 3D Basemaps * * _Since version 4.28_ * * The 3D Basemaps can be accessed using the basemap id in the table below. They are designed to be used as basemaps in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * Value | Source | * ------|------- | * `topo-3d` | [Topographic](https://www.arcgis.com/home/item.html?id=0560e29930dc4d5ebeb58c635c0909c9) | * `navigation-3d` | [Navigation](https://www.arcgis.com/home/item.html?id=00a5f468dda941d7bf0b51c144aae3f0) | * `navigation-dark-3d` | [Navigation (Dark)](https://www.arcgis.com/home/item.html?id=5a1365328b4943f09a54cf5fd1205707) | * `osm-3d` | [OpenStreetMap](https://www.arcgis.com/home/item.html?id=1c071fcf8ff2448599b0547116e2de55) | * `gray-3d` | [Light Gray Canvas](https://www.arcgis.com/home/item.html?id=35cdf329d663403b99df27d6ca5fa38d) | * `dark-gray-3d` | [Dark Gray Canvas](https://www.arcgis.com/home/item.html?id=a8b7322a5fe94002bb0f5e0eeb0c5c18) | * `streets-3d` | [Streets](https://www.arcgis.com/home/item.html?id=1754f80e7e6644e28ce0c4d35066e392) | * `streets-dark-3d` | [Streets (Dark)](https://www.arcgis.com/home/item.html?id=8a4efa2c20484ec9b4557895e65736ff) | * * > [!WARNING] * > * > **Known Limitations** * > * > 3D Basemaps can only be used in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * ##### 2D (legacy) * * _Since version 4.0_ * * The legacy basemaps can be accessed using the basemap id in the table below. These are references to [enhanced](https://developers.arcgis.com/documentation/mapping-apis-and-services/service-endpoints/#2-enhanced-endpoint) basemap endpoints. * * <details> * <summary>Read More</summary> * * Value | Source | * ------|------- | * `satellite` | [World Imagery](https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer) | * `hybrid` | [Hybrid Reference Layer](https://www.arcgis.com/home/item.html?id=30d6b8271e1849cd9c3042060001f425) and [World Imagery](https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer) | * `oceans` | [World Ocean Reference](https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer) and [World Ocean Base](https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer) | * `osm` | [OpenStreetMapLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/OpenStreetMapLayer/) | * `terrain` | [World Reference Overlay](https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer) and [World Hillshade](https://services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer) | * `dark-gray` / `dark-gray-vector` | [Dark Gray Canvas](https://www.arcgis.com/home/item.html?id=c11ce4f7801740b2905eb03ddc963ac8) | * `gray` / `gray-vector` | [Light Gray Canvas](https://www.arcgis.com/home/item.html?id=8a2cba3b0ebf4140b7c0dc5ee149549a) | * `streets` / `streets-vector` | [World Street Map](https://www.arcgis.com/home/item.html?id=de26a3cf4cc9451298ea173c4b324736) | * `streets-night-vector` | [World Street Map (Night)](https://www.arcgis.com/home/item.html?id=86f556a2d1fd468181855a35e344567f) | * `streets-navigation-vector` | [World Navigation Map](https://www.arcgis.com/home/item.html?id=63c47b7177f946b49902c24129b87252) | * `topo` / `topo-vector` | [World Hillshade](https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer) and [World Topographic Map](https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5) | * `streets-relief-vector` | [World Hillshade](https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer) and [World Street Map (with Relief)](https://www.arcgis.com/home/item.html?id=b266e6d17fc345b498345613930fbd76) | * * </details> * * @example * // create the basemap from a string id representing the basemap style * const map = new Map({ * basemap: "arcgis/topographic" * }); * * // create the basemap from a BasemapStyle object * const map = new Map({ * basemap: { * style: { * id: "arcgis/outdoor", * language: "es" // place labels will be displayed in spanish * } * } * }); * @example * // Set the basemap from a string ID in the constructor * const map = new Map({ * basemap: "dark-gray-3d" * }); * * // Set the basemap after the map instance is created * map.basemap = "topo-3d"; * @example * // Create a VectorTileLayer from a style URL * const mapBaseLayer = new VectorTileLayer({ * url: "https://arcgis.com/sharing/rest/content/items/b5676525747f499687f12746441101ef/resources/styles/root.json" * }); * * // Create a Basemap with the VectorTileLayer * const customBasemap = new Basemap({ * baseLayers: [mapBaseLayer], * title: "Terrain" * }); * * // Set the basemap to the customBasemap * const map = new Map({ * basemap: customBasemap * }); */ get basemap(): Basemap | null | undefined; set basemap(value: BasemapProperties | string | null | undefined); /** * * A collection of editable layers. Layers are considered editable if they have editing capabilities, and if the authenticated user has the * necessary privileges needed to edit the layers. * * @since 4.20 * @see [Editor component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/) * @see [Sample - Edit features with the Editor component](https://developers.arcgis.com/javascript/latest/sample-code/editor-basic/) */ get editableLayers(): ReadonlyCollection<EditableLayerUnion>; /** * A container of all [focus areas](https://developers.arcgis.com/javascript/latest/references/core/effects/FocusAreas/) present in the map. * * > [!WARNING] * > * > **Known Limitations** * > * > Focus areas are only supported in [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). * * @see [FocusAreas](https://developers.arcgis.com/javascript/latest/references/core/effects/FocusAreas/) * @see [Sample - Focus Area](https://developers.arcgis.com/javascript/latest/sample-code/focus-area/) */ get focusAreas(): FocusAreas; set focusAreas(value: FocusAreasProperties); /** * Specifies the surface properties for the map. In MapView, this property is used by the * [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/) when the * [profile](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/#profiles) contains an * [ElevationProfileLineGround](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLineGround/). * In 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), it renders the * terrain or topographical variations in the real world on the map's surface * with a collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/). * * This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/), or one of the following strings: * - `world-elevation` for a default instance of ground using the * [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). * - `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the * [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). * * The ground may not be set to `null` or `undefined`, it is guaranteed to always * contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/). The elevation can be removed from the ground * by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/) instance or by removing all * the ground layers. * * @see [ElevationLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/) * @see [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/) * @example * // Use the world elevation service * const map = new Map({ * basemap: "topo-vector", * ground: "world-elevation" * }); * @example * // Create a map with the world elevation layer overlaid by a custom elevation layer * const worldElevation = new ElevationLayer({ * url: "//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" * }); * const customElevation = new ElevationLayer({ * url: "https://my.server.com/arcgis/rest/service/MyElevationService/ImageServer" * }); * const map = new Map({ * basemap: "topo-vector", * ground: new Ground({ * layers: [ worldElevation, customElevation ] * }) * }); */ get ground(): Ground; set ground(value: GroundProperties | string | null | undefined); /** * Destroys the map, and any associated resources, including its [layers](https://developers.arcgis.com/javascript/latest/references/core/Map/#layers), [basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap), [tables](https://developers.arcgis.com/javascript/latest/references/core/Map/#tables), and [ground](https://developers.arcgis.com/javascript/latest/references/core/Map/#ground). * These can no longer be used once the map has been destroyed. To prevent these objects from being destroyed, * remove them from the map before calling `destroy()`. * * ``` * // prevent the layers from being destroyed by removing them from the map * const layers = map.layers.removeAll(); * * // prevent the tables from being destroyed by removing them from the map * const tables = map.tables.removeAll(); * * // unset basemap from the map so that it is not destroyed * const basemap = map.basemap; * map.basemap = null; * * // remove ground layers from the map so that they aren't destroyed * const groundLayers = map.ground.removeAll(); * * // destroy the map and any remaining associated resources * map.destroy(); * ``` * * @since 4.17 * @see [WebMap.destroy()](https://developers.arcgis.com/javascript/latest/references/core/WebMap/#destroy) * @see [WebScene.destroy()](https://developers.arcgis.com/javascript/latest/references/core/WebScene/#destroy) * @see [Basemap.destroy()](https://developers.arcgis.com/javascript/latest/references/core/Basemap/#destroy) * @see [Ground.destroy()](https://developers.arcgis.com/javascript/latest/references/core/Ground/#destroy) * @see [Layer.destroy()](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#destroy) * @see [PortalItem.destroy()](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/#destroy) */ destroy(): void; } declare const MapSuperclass: typeof EventedAccessor & typeof LayersMixin & typeof TablesMixin