ArcGIS Platform

The Basemap Styles Service v2 is Now Released

[Update] We are pleased to announce the basemap styles service v2 is now in beta released!

With this version, you can access all of the map styles you did with the basemap styles service (v1), but now there are more options.

Here’s what’s new:  

To learn more about the service, resources, and the types of apps you can build, keep reading! 


Accessing the service

To access the service, you need the following: 

1. ArcGIS account: You need either an ArcGIS Developer account or an ArcGIS Online account. If you don’t have one, you can sign up for a free account here.

2. Access token:  You will need an access token, such as an API key. If you are using API keys, there isn’t a new API key scope for the service.

[Updated] 3. Client API: You can now access the styles using the new Esri Leaflet vector plugin. You can also access endpoints directly with vector tile layers to display the styles in MapLibre GL JS or OpenLayers.  

Note: You can also access the new service with ArcGIS Maps SDKs today and full support is coming soon. 

New developer resources

As part of the release, we added content to the Mapping APIs and location services guide, which contains code and example applications demonstrating how to access the service. There is also a brand new REST API reference  that documents all of the URL endpoints and styles.

New URL endpoint

The basemap styles service v2 has a new URL endpoint that is more RESTful. Similar to the basemap styles service v1, you can return the style as either web map JSON or JSON based on the Mapbox style specification.  

To reference a style, you set arcgis or osm as the provider, webmaps or styles as the response JSON, and the basemap style you want. For example:

Style JSON

https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/outdoor
?token=<ACCESS_TOKEN>

Web map JSON

https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps/arcgis/outdoor
?token=<ACCESS_TOKEN>

To see a complete list of basemap styles available, go to the API reference.

New map styles

With this release, you have access to new map styles such as ArcGIS Outdoor and OSM navigation.

[Updated]: Check out the code to access the new styles with the Esri Leaflet vector basemap plugin and with MapLibre GL JS.

ArcGIS Outdoor 

const map = L.map("map").setView([37.75, -122.23],10);
L.esri.Vector.vectorBasemapLayer("arcgis/outdoor", {
apiKey, version:2)}.addTo(map);

OSM Navigation

const map = new maplibregl.Map({
  container: "map", 
  style: "https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/osm/navigation?token=<ACCESS_TOKEN>",
  zoom: 13,
  center: [-119.52, 37.74]
});

To get the code and view the new styles, go to the tutorials in the Esri Leaflet, MapLibre GL JS and OpenLayers guides. 

Localized place labels

Another key feature of the new service is the ability to localize place labels for any basemap style. All you need to do is affix the language parameter to the URL request and set one of the 30 available language codes. You can also set language to local to automatically switch to the local language as you navigate to different parts of the world.

Place labels in Japanese

const map = new maplibregl.Map({
  container: "map", 
  style: "https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/light-gray
?token=<ACCESS_TOKEN>&language=ja",
  zoom:3,
  center: [138.25, 36.20]
});

Ready to give it a try?

To start building apps with the new service, check out the Mapping APIs and location services guide and REST API reference. Remember to leave feedback using the feedback widget!  

About the authors

Anita Kemp is a product engineer on the Developer Experience team.

Allan Laframboise is the product engineering lead for documentation for the Developer Experience team.

0 Comments
Inline Feedbacks
View all comments

Next Article

Engaging Volunteers for a Cause

Read this article