mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
feat(widget): update Mapbox API due to classic style deprecation
Since June 1, 2020, the Mapbox classic styles are deprecated and may be removed in the future. This change updates the Leaflet code to use the currently supported Mapbox style API according to the official documentation at https://docs.mapbox.com/help/troubleshooting/migrate-legacy-static-tiles-api/ See #1854
This commit is contained in:
parent
d325991ffb
commit
841053c6c8
1 changed files with 4 additions and 2 deletions
|
@ -266,10 +266,12 @@
|
|||
} else {
|
||||
let map = new L.map('map').setView([lat, lng], zoom);
|
||||
if (map_provider == 3 && api_key.length) {
|
||||
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
|
||||
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
||||
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
|
||||
tileSize: 512,
|
||||
maxZoom: 18,
|
||||
id: 'mapbox.streets',
|
||||
zoomOffset: -1,
|
||||
id: 'mapbox/streets-v11',
|
||||
accessToken: api_key
|
||||
}).addTo(map);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue