我正在構建一個應用程序,可以將來自Astrodigital的衛星圖像覆蓋層加載到Leaflet地圖上。使用Mapbox API加載瓦片層,得到404錯誤
示例here工作正常。我的地圖箱鑰匙工作正常。
我嘗試使用的圖像我有Astrodigital,它具有這個屬性:
"map_id": "astrodigital.6e96e464d72a4647838cd3d014160f1f"
這是格式:
var mbUrl = `https://api.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}`;
...
L.tileLayer(mbUrl, {id: 'astrodigital.6e96e464d72a4647838cd3d014160f1f', token: accessToken}).addTo(map);
但我得到一個404錯誤: GET https://api.mapbox.com/v4/astrodigital.6e96e464d72a4647838cd3d014160f1f/...blablabla。 .. 404(Not Found)
關於我應該檢查什麼的任何想法?
你使用'api.mapbox.com'的任何原因,而你提到的例子使用'{s} .tiles.mapbox.com'? – ghybs
我先試過那個,也沒有運氣。我查看了Astrodigital地圖查看器調用切片的方式,它是'api.mapbox.com',所以我認爲我會嘗試這種方式。 –