import BasemapStyle from "@arcgis/core/support/BasemapStyle.js";const BasemapStyle = await $arcgis.import("@arcgis/core/support/BasemapStyle.js");- Inheritance:
- BasemapStyle→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.28
The style of the basemap from the basemap styles service (v2). The basemap styles service is a ready-to-use location service that serves vector and image tiles representing geographic features around the world.
You can use the basemap styles service to display:
- Streets and navigation styles
- Imagery, oceanic, and topographic styles
- Creative styles such as nova and blue print
- Localized place labels
- Places with styles - since 4.29
- Worldview boundaries - since 4.29
Use of the basemap style service requires authentication via an API key or user authentication. To learn more about API keys, see the API keys section in the Esri Developer documentation.
Example
const basemap = new Basemap({ style: new BasemapStyle({ id: "arcgis/human-geography", language: "es" // place labels will be displayed in spanish })})Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
apiKey
- Since
- ArcGIS Maps SDK for JavaScript 4.31
An authorization string used to access a resource or service. API keys are generated and managed in the portal. An API key is tied explicitly to an ArcGIS account; it is also used to monitor service usage. Setting a fine-grained API key on a specific class overrides the global API key.
id
The id of the basemap style. The values are of the form {provider}/{style}, for example `arcgis/navigation``.
See Basemap styles -> Requests for the full list of available styles.
Example
// sets the basemap to the ArcGIS navigation night stylebasemap.style = { id: "arcgis/navigation-night"}
// sets the basemap to the ArcGIS outdoor stylebasemap.style.id = "arcgis/outdoor"; language
The language of the place labels in the basemap style.
Choose from a variety of supported languages, including global and local.
If not set, the app's current locale is used.
If the app's locale is not supported by the service, the language will fall back to "global".
Example
// basemap place labels will in spanishbasemap.style = { id: "arcgis/outdoor", language: "es"}
// basemap style will use the names of places in their local language (e.g. "Lisboa" for Lisbon)basemap.style.language = "local"; places
- Since
- ArcGIS Maps SDK for JavaScript 4.29
Indicates whether to display places with the basemap style.
Only supported with the arcgis/navigation and arcgis/navigation-night styles.
Example
const basemapWithPlaces = new Basemap({ style: new BasemapStyle({ id: "arcgis/navigation", places: "all" })}) worldview
- Since
- ArcGIS Maps SDK for JavaScript 4.29
Displays country boundaries and labels based on a specific view of a country. Choose from a variety of supported worldviews.
Worldviews can only be specified for arcgis basemap styles.
When a specific worldview is chosen, it is possible for some place labels to change language.
However, when a specific language is provided, it will take priority over the language changes associated with the worldview.
Example
const moroccoBasemap = new Basemap({ style: new BasemapStyle({ id: "arcgis/streets", worldview: "morocco", language: "ar" })})