From e994b9487b69ad554e63783b543872f90521fdbd Mon Sep 17 00:00:00 2001 From: Mateusz Lisewski Date: Fri, 12 Jan 2024 01:38:06 +0100 Subject: [PATCH] Update scripts.js --- scripts.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts.js b/scripts.js index 1b3adc19..1d215f20 100644 --- a/scripts.js +++ b/scripts.js @@ -161,8 +161,9 @@ async function getTA2MapData(latitude, longitude) { if (mapContainer && mapContainer._leaflet_id) { mapContainer._leaflet_id = null; } + mapContainer.innerHTML = ''; - const TA2Map = L.map('map-box-temperature', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 10); + TA2Map = L.map('map-box-temperature', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 10); const mapLayer = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, @@ -187,7 +188,9 @@ async function getPR0MapData(latitude, longitude) { mapContainer._leaflet_id = null; } - const PR0Map = L.map('map-box-precipitation', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 7); + mapContainer.innerHTML = ''; + + PR0Map = L.map('map-box-precipitation', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 7); const mapLayer = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, @@ -211,7 +214,9 @@ async function getWNDMapData(latitude, longitude) { mapContainer._leaflet_id = null; } - const WNDMap = L.map('map-box-wind', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 10); + mapContainer.innerHTML = ''; + + WNDMap = L.map('map-box-wind', {dragging: false, scrollWheelZoom: false, touchZoom: false}).setView([latitude, longitude], 10); const mapLayer = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18,