Mapbox tiles and Leafletjs

后端 未结 3 745
不知归路
不知归路 2020-12-23 16:20

I\'m trying to load some additional tile layers on my map but I can\'t quite figure it out. The ones that I currently have I only have thanks to someone that provided a tut

相关标签:
3条回答
  • 2020-12-23 16:42

    I actually finally found the answer.

    The URL string needed to be updated to

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

    The available styles ({id}) are

    • streets-v9
    • satellite-streets-v9
    • light-v9
    • dark-v9
    • outdoors-v9
    0 讨论(0)
  • 2020-12-23 16:56

    Full list of Mapbox classic map IDs, ie for Leaflet, are at https://www.mapbox.com/api-documentation/#maps.

    At the time of writing the IDs are:

    • mapbox.streets
    • mapbox.light
    • mapbox.dark
    • mapbox.satellite
    • mapbox.streets-satellite
    • mapbox.wheatpaste
    • mapbox.streets-basic
    • mapbox.comic
    • mapbox.outdoors
    • mapbox.run-bike-hike
    • mapbox.pencil
    • mapbox.pirates
    • mapbox.emerald
    • mapbox.high-contrast
    0 讨论(0)
  • 2020-12-23 17:04

    Actually, the new tile layers 'styles' that Mapbox was referring to were vector tile layers.

    Mapbox-GL JS uses vector styles which you listed (xxx-v9). (up to date as of 05/2019)

    Mapbox JS is built on top of Leaflet (L.tilelayer()) and uses raster tilesets, which are images. Here are the available basemaps from Mapbox.

    0 讨论(0)
提交回复
热议问题