remove window.onload

This commit is contained in:
Xaloc 2023-02-27 14:09:01 +01:00
parent ff5942cba1
commit 72b9c4672b

View File

@ -86,7 +86,8 @@
document.getElementById('kp_3').textContent = Number(kp_3.toFixed(2)); document.getElementById('kp_3').textContent = Number(kp_3.toFixed(2));
} }
window.onload = api; //window.onload = api;
api();
var mymap = L.map('mapid').setView([67.8488, 20.3027], 6); var mymap = L.map('mapid').setView([67.8488, 20.3027], 6);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
@ -112,7 +113,8 @@
addClouds(data.geometry.coordinates[i][1],data.geometry.coordinates[i][0],data.timeSeries[0].parameters[0].values[i]) addClouds(data.geometry.coordinates[i][1],data.geometry.coordinates[i][0],data.timeSeries[0].parameters[0].values[i])
} }
} }
window.onload = clouds; //window.onload = clouds;
clouds();
function addClouds(lat,lon,opa){ function addClouds(lat,lon,opa){
var circle = L.circle([lat, lon], { var circle = L.circle([lat, lon], {