Mapbox provides many URLs and code snippets to help you add your custom Mapbox maps to other mapping tools. This tutorial will show you how you can add any Mapbox map as a layer in ArcMap or QGIS as WMTS.
WMTS stands for Web Map Tile Service. It is a standard protocol for serving image-based map tiles over the internet. WMTS is a popular way to add custom maps to from third-party services to GIS software like ArcMap and QGIS.
Mapbox provides a WMTS endpoint for each style you create in Mapbox Studio, which will generate raster tiles for your style.
Before diving in, make sure you have the following ready to go:
If you try to add a private map style to ArcMap or QGIS, you will see an
error message like: "Failed to download capabilities: Download of capabilities
failed: Error transferring
https://api.mapbox.com/styles/v1/YOUR_USERNAME/YOUR_STYLE_ID/wmts?access_token=YOUR_MAPBOX_ACCESS_TOKEN&SERVICE=WMS&REQUEST=GetCapabilities
ArcMap can read map tiles protocol, which is what you'll use to add your Mapbox styles. First, you will build a WMTS endpoint for the style you would like to add to ArcMap. Next, you will add this WMTS endpoint to your ArcMap project.
The WMTS endpoint that you will use to add your map in ArcMap needs to follow this format:
https://api.mapbox.com/styles/v1/YOUR_USERNAME/YOUR_STYLE_ID/wmts?access_token=YOUR_MAPBOX_ACCESS_TOKEN
There are three pieces of this URL that you will need to change:
mapbox://styles/YOUR_USERNAME/YOUR_STYLE_ID
. The style ID is the last part of this URL.When you have customized a WMTS endpoint with your username, the style ID, and your access token, it will be ready for you to use in ArcMap.
To get started in ArcMap:
Click the Add Data button in the toolbar to open the Add Data dialog box.
At the top of the dialog box, click the arrow next to Look in: and select GIS Servers.
Double-click Add WMTS Server to open the Add WMTS Server dialog box.
In the URL field at the top, paste the WMTS endpoint URL that you customized in the previous step.
In the Server Layers section, click Get Layers. When prompted for a username and password, click Cancel. You may have to click it several times to dismiss the box.
When the layers are loaded in the window, click OK.
You should see Mapbox on api.mapbox.com in the Add Data dialog box. Double click it, select the name of your style in the next dialog box, then click Add.
You should see your map as a layer inside your ArcMap project. Note that each style will have to be added individually.
QGIS can also read map tiles from a WMTS server. First, build a WMTS endpoint for the style you would like to add to QGIS. Next, add this WMTS endpoint to your QGIS project.
The WMTS endpoint that you will use to add your map in QGIS needs to follow this format:
https://api.mapbox.com/styles/v1/YOUR_USERNAME/YOUR_STYLE_ID/wmts?access_token=YOUR_MAPBOX_ACCESS_TOKEN
There are three pieces of this URL that you will need to change:
mapbox://styles/YOUR_USERNAME/YOUR_STYLE_ID
. The style ID is the last part of this URL.
When you have customized a WMTS endpoint with your username, the style ID, and your access token, it will be ready for you to use in QGIS.
To add your Mapbox map to QGIS:
In QGIS, click the Layer menu, then select Add Layer, then click on Add WMS/WMTS layer....
Make sure the Layers tab is selected in the dialog box. Below the dropdown menu at the top of the box, click New.
Give the layer a name and add the WMTS endpoint URL that you customized in the previous step. Press OK.
Back in the Add Layer(s) from a WM(T)S Server dialog box, the name of your layer should appear in the box at the top. When you see this, click Connect.
The Tilesets tab should open with a single layer. Select that layer and click Add, then click Close to close the dialog box.
You should see your map as a layer inside your QGIS project. Note that any style you would like to visualize will have to be added individually.
Congratulations on adding your Mapbox map as a wmts layer in ArcMap or QGIS! You can now use your custom Mapbox maps in your GIS projects.