1

I have created a Mapbox custom style map and want to use it in Leaflet. All the examples on this site and the web refer to a map ID that doesn't seem to be used anymore.

For example:

https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}

Mapbox seems to currently only provide a "Leaflet URL". For example:

https://api.mapbox.com/styles/v1/myusername/cj7v3234324/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYWltZWVfvevervCIsImEiOiJjajdrvevrjQwNGx4MndudjVqbGd1ZG1xIn0.5j60jT7XVIkSKpw7vdvsdJXA

This URL includes what looks like a style reference and an access token but no .png.

I cannot make this work in any way with Leaflet L.tilelayer. I have tried various ways of editing the URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.