What is the Basemap Styles service?
The ArcGIS Basemap Styles service, also referred to as the Basemap Styles service, is a data source that provides basemap styles and data for the world. The style format is a Mapbox style or ArcGIS web map and the data is served as vector tiles and/or map tiles depending on the style used. The data is in the Web Mercator spatial reference. The service provides styles from the ArcGIS Basemap style family and Open Basemap style family. The styles are grouped into the following categories: streets, topography, satellite, reference, and creative. They include a number of popular basemap styles such as streets, navigation, outdoor, and imagery. The service can also display key styles with a preferred language, worldview, or with places.
You can use the service to:
- Build mapping applications to display basemap styles for the world.
- Provide the underlying visual and geographic context for a map.
- Display styles such as streets, navigation, light-gray, and imagery.
- Display families of styles that use authoritative or open source data providers.
- Access styles from ArcGIS Maps SDKs and open source libraries.
- Display your own custom styles created with the ArcGIS Vector Tile Style Editor.
- Display styles with a preferred language, worldview, or with places.
How to use the Basemap Styles service
To request a basemap style, you need to use a mapping API that supports either a Mapbox style or ArcGIS web map format. You can get a style by using the service URL with the appropriate path parameters and query parameters. The path parameters specify the style response, style family, and style name. When using the ArcGIS Maps SDKs, helper classes and enumerations can be used to access each style. When using open source libraries, you typically need to define the service URL and path parameters yourself. You may also need to manually provide Esri and data attribution. The query parameters can be used to set preferences for the style returned.
The steps to use the service are:
- Get an access token with the correct privilege.
- Define the service URL and path parameters for the appropriate style response, style family, and style name.
- Set the query parameters to display the preferred language, worldview, and places.
const navigation = new Basemap({
style: new BasemapStyle({
id: "arcgis/navigation" //arcgis/navigation, //arcgis/topographic
})
});
const map = new Map({
basemap: navigation,
constraints: {
snapToZoom: false,
},
});
Service URL
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2
Path parameters
These are required parameters to specify the style to access.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/{style_response}/{style_family}/{style_name}
Name | Description | Example |
---|---|---|
{style | Required: The format of the JSON structure to return. | webmaps or styles |
{style | Required: The name of the style family for the type of data source providers. | arcgis or open |
{style | Required: Name of the style in each style family. | navigation |
Query parameters
These are optional parameters to set style preferences and the access token. Some are only available for key styles.
Name | Description | Example |
---|---|---|
language | Display labels with a preferred language setting. | language=en |
worldview | Display geography boundaries for a worldview. | worldview=morocco |
places | Display places with the style. Only available for the ArcGIS Basemap style family and some styles. | places=all |
token | The access token to access the service. Required unless authorization headers are used. Must be granted privilege: premium:user:basemaps. | token= or X- |
echo | Response contains embedded token to access style resources. Default is true. When false, the client API must provide token for all style resources. | echo |
Tokens
To request styles from the basemap service, you need an access token or a session token.
Access token
To use an access token, you first need to implement a type of authentication. The resulting token must have the premium
privilege. Using the access token directly to access styles will result in basemap tile usage charges. To learn more, go to Basemap usage > Tile usage model.
Session token
To use a session token, you first have to start a basemap session to get the token. This will result in basemap session usage charges To learn how learn more, go to Basemap usage > Session usage model.
How to use tokens
To include a token with requests to basemap styles, you can use a query parameter or authorization header.
Query parameter
An access token or session token can be used as the value of the token
query parameter.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/{style_response}/{style_family}/{style_name}?token=<YOUR_TOKEN>
Authorization header
Only an access token can be used as the value for an authorization header.
GET https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/{style_response}/{style_family}/{style_name} HTTP/1.1
Host: basemapstyles-api.arcgis.com
Authorization: Bearer <YOUR_TOKEN>
Attribution
All applications that use an ArcGIS API, SDK, service, content, or data must display Esri and data attribution. This also applies to applications that use ArcGIS Basemap services. When using the ArcGIS Maps SDKs, the correct attribution is typically displayed for you in the map. However, when using open source or other third party libraries, you may need to take additional steps to access the basemap service and display the attribution for Esri and data providers.
Style response
The style response is the type of JSON structure returned for a basemap style.
The /styles
endpoint provides access to styles as JSON based on the Mapbox style specification. This is typically used when using open source or third party libraries.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/{style_family}/{style_name}
Style families
A style family is the name for a set of styles that use the same set of data providers.
The /arcgis/{style
endpoint gives you access to ArcGIS Basemap styles that
TomTom, Garmin, FAO, NOAA, USGS, OpenStreetMap (OSM) contributors, and the GIS User Community.
To get a list of all the styles, use the /self
request. You will need to filter the /arcgis/
names.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/self
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps/self
Style names
The style name is the name of a style in a style family.
The /{style
endpoint returns the style JSON as a Mapbox style or ArcGIS web map.
Use this endpoint to get a style that belongs to the ArcGIS Basemap styles family.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/{style_name}
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps/arcgis/{style_name}
Use the /self
request to get the style properties and supported parameters.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/{style_response}/{style_family}/{style_name}/self
Example
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/navigation
What's next?
Learn how to build mapping applications with the basemap style service.