WIP **** WIP

funktioniert nur teilweise: Umschaltung auf en geht seltsamerwesie nicht
This commit is contained in:
rxf
2023-04-12 12:43:03 +02:00
parent c8682aa713
commit bf2aa26952
21 changed files with 370 additions and 57 deletions
+7 -4
View File
@@ -12,10 +12,10 @@ let clickedcoords = {}
const colorscale = ['#d53e4f', '#fc8d59', '#fee08b', '#e6f598', '#99d594', '#3288bd', '#808080'];
const dba = [100, 80, 60, 40, 20, 0, -999];
const APIURL = '/api/getmapdata?'
export async function showMap(params) {
utils.removeTabs()
if(map && map.remove) {
map.off();
map.remove();
@@ -58,11 +58,14 @@ export async function showMap(params) {
params.sid = clickedSensor
let triggerEl = document.querySelector('#livetab')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
localStorage.setItem('activeTab', 'livetab')
let ok = await showChart(params, 'live', 'dlive')
if (ok) {
await loadAll(params)
}
map.setView([clickedcoords.lat, clickedcoords.lng]);
params.center = [clickedcoords.lat, clickedcoords.lng]
// map.setView([clickedcoords.lat, clickedcoords.lng]);
document.querySelector('#sellan').style.display = 'none'
})
})
}
@@ -164,7 +167,7 @@ export async function buildMarkers() {
west: bounds.getWest(), south: bounds.getSouth(),
east: bounds.getEast(), north: bounds.getNorth()
}
const url = `/api/getmapdata?type=noise&box=${bounds.toBBoxString()}`
const url = APIURL + `type=noise&box=${bounds.toBBoxString()}`
let ret = await fetch(url)
.catch(e => {
@@ -264,7 +267,7 @@ async function setCenter(adr) {
// Show the last date below tha map grafics
async function showLastDate(ld) {
const url = `/api/getmapdata?type=noise`
const url = APIURL + 'type=noise'
let ret = await fetch(url)
.catch(e => {
console.log(e)