Learn how to create a custom basemap style using ArcGIS Vector Tile Style Editor and display it in a map.
A basemap style provides the visual context for a map. You can use the default basemap styles provided by the ArcGIS Basemap services or create a custom basemap style with the ArcGIS Vector Tile Style Editor.
In this tutorial, use ArcGIS Vector Tile Style Editor and the MapLibre ArcGIS plugin to create and display a custom basemap style in a map.
Prerequisites
You need an ArcGIS Location Platform or ArcGIS Online account.
Steps
Create a custom basemap style
You can create your own custom basemap with the ArcGIS Vector Tile Style Editor.
-
Go to the Vector Tile Style Editor.
-
Sign in with your ArcGIS account.
-
Click + New style.
-
In the Select a style to continue panel, click Popular > Light Gray Canvas.
-
In left-panel, click Quick Edit. Style the basemap using Colors, Font, Label Size, and Road Width. For example:
- Colors
- Land:
#cbe8b0
- Water:
#b9dbf7
- Roads:
#f0f1f0
- Boundaries:
#ffffff
- Buildings:
#ebe7dc
- Nature:
#f0fae6
- Land:
- Colors
-
In the search tool of the map, enter
Yosemite National Park
. -
Click on any green area to open the Admin0 forest or park layer.
-
In the map, zoom out to level 6 so that the layer disappears.
-
In the Layer Editor > Visibility panel, set the first number of the Visible Zoom Range to 3 to make the layer visible.
-
In the Layer Editor > Appearance panel, set the fill and outline color properties to change at different zoom levels using either hex codes or the color selector. For example:
- Color > Settings icon > Set Value by Zoom level:
3
#ddf0ca
6
#cbe5b1
- Click Add Stop and enter:
10
#bae291
.
- Outline Color:
#bbd4a2
- Opacity:
60%
- Color > Settings icon > Set Value by Zoom level:
-
In the toolbar, click Save As to save your customized basemap. Enter a Title and Tags.
Get the starter app
Select a type of authentication below and follow the steps to create a new application.
Set up authentication
Create developer credentials in your portal for the type of authentication you selected.
Set developer credentials
Use the API key or OAuth developer credentials so your application can access ArcGIS services.
Display the custom basemap style
Use the MapLibre ArcGIS plugin to access the custom basemap style by referencing its item ID. You can find its item ID by accessing it in your portal or the ArcGIS Vector Tile Style Editor.
-
Go to the item page of the custom basemap style that you previously created and find its item ID. The ID is at the end of the URL, for example
9d94a890b76a417cad8a748df4f97336
. -
Reference the item ID in your
Basemap
object.Style Use dark colors for code blocks const basemapStyle = maplibreArcGIS.BasemapStyle.applyStyle(map, { style: '9d94a890b76a417cad8a748df4f97336', token: accessToken });
Run the app
Run the app.
The map should display the custom basemap style created using ArcGIS Vector Tile Style Editor.What's next?
Learn how to use additional location services in these tutorials: