2

I'm working with this famous code:

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', 
    maxZoom: 18,
    id: 'CAN'T FIND IT',
    accessToken: 'FOUND IT'
}).addTo(mymap);

I can't find the ID of my mapbox but when i change it to mapbox.streets, the map shows up. Mapbox gives me a style URL, what should i do with it?

2 Answers 2

1

I found how to get the ID for my map Go to TILESITS

enter image description here

Then choose your map

enter image description here

0

In Mapbox Studio go to Styles and choose "Share, develop & use"

enter image description here

Then under "Develop with this style" choose "Leaflet".

enter image description here

You can then just copy paste that URL directly:

L.tileLayer('LEAFLET URL FROM MAPBOX', {
    maxZoom: 18
}).addTo(mymap);
1
  • Thank you for your response but i guess this is a style URL anyway it worked
    – Nordinator
    May 22, 2017 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.