style URL
A style URL allows you to reference a style created with Mapbox Studio.
A complete style URL, like mapbox://styles/mapbox/streets-v11
, is comprised of three components:
mapbox://styles
: points to the Mapbox Styles API/mapbox
: your Mapbox username/streets-v11
: your style's unique ID
You can find the style URL on your Styles page in Mapbox Studio. Click on the menu next to a style to reveal its style URL. Click the icon to copy the style URL.
For each custom style you create in Mapbox Studio, there is a draft and a production style URL available. If you are using the draft version of your style, /draft
will also be appended to the end of the style URL.
Style URLs do not work with Mapbox.js or Leaflet directly. When using Mapbox.js, you can use a style URL to add a style layer, as in this example:
var map = L.mapbox.map('map')
.setView([40, -74.50], 9)
.addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));
These libraries use the Static Tiles API to render raster tiles from Mapbox Studio styles with L.mapbox.styleLayer
and L.tileLayer
.
Related resources: