Skip to content
import BasemapStyle from "@arcgis/core/support/BasemapStyle.js";
Inheritance:
BasemapStyleAccessor
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.

See also
Example
const basemap = new Basemap({
style: new BasemapStyle({
id: "arcgis/human-geography",
language: "es" // place labels will be displayed in spanish
})
})

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
declaredClass
readonly inherited
id
"none" | "all" | "attributed" | null | undefined

apiKey

Property
Type
string | null | undefined
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.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

id

Property
Type
string | null | undefined

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.

See also
Example
// sets the basemap to the ArcGIS navigation night style
basemap.style = {
id: "arcgis/navigation-night"
}
// sets the basemap to the ArcGIS outdoor style
basemap.style.id = "arcgis/outdoor";

language

Property
Type
string | null | undefined

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

See also
Example
// basemap place labels will in spanish
basemap.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

Property
Type
"none" | "all" | "attributed" | null | undefined
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.

See also
Example
const basemapWithPlaces = new Basemap({
style: new BasemapStyle({
id: "arcgis/navigation",
places: "all"
})
})

serviceUrl

Property
Type
string

The URL to the basemap styles service.

Default value
"https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2"

worldview

Property
Type
string | null | undefined
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.

See also
Example
const moroccoBasemap = new Basemap({
style: new BasemapStyle({
id: "arcgis/streets",
worldview: "morocco",
language: "ar"
})
})