From 841053c6c8f2fcdee27fa99671f5fa67f2c66ae9 Mon Sep 17 00:00:00 2001 From: zertrin Date: Fri, 25 Sep 2020 23:28:21 +0800 Subject: [PATCH] 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 --- wowchemy/assets/js/academic.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wowchemy/assets/js/academic.js b/wowchemy/assets/js/academic.js index 181abe22..c6741f79 100644 --- a/wowchemy/assets/js/academic.js +++ b/wowchemy/assets/js/academic.js @@ -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 © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', + tileSize: 512, maxZoom: 18, - id: 'mapbox.streets', + zoomOffset: -1, + id: 'mapbox/streets-v11', accessToken: api_key }).addTo(map); } else {