Leaflet map not displayed

  1. background map is not displayed

clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.06,2021

obviously, this official example uses mapBox's map. When configuring the accessToken of the map, you need to fill in the corresponding key. You go to mapBox's website to apply for one to fill in, and the map will come out. Or you can change to another online map as the base map


you need to apply for tocken, on the mapbox website and replace the accessToken in the code.
or try a different tile service
L.tileLayer ("http://t2.tianditu.cn/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&format=tiles").addTo(map);


you can run it by copying the example directly from the official website.
at first glance, you did not fill in token. F12 see what's wrong with the next report

Menu