Blank map tiles - Error 410 gone (Mapbox & Leaflet JS)

前端 未结 3 1181
闹比i
闹比i 2021-01-18 03:20

I am using Leaflet JS and MapBox to create a map. My browser displays as below:

The map does not show at all, my map tile is blank. The errors that I get in t

3条回答
  •  一整个雨季
    2021-01-18 04:03

    Mapbox mapbox.streets tiles was deprecated for new static styles api.

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

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

    Also replace mapbox.streets for mapbox/streets-v11 in id parameter of L.tileLayer() object.

    Official docs: https://docs.mapbox.com/api/maps/#static-tiles

提交回复
热议问题