,,,
This commit is contained in:
parent
1093b41260
commit
796960bdaf
16
markers.js
16
markers.js
|
|
@ -20,10 +20,20 @@ async function GetMarkerData() {
|
||||||
|
|
||||||
|
|
||||||
function RenderMarkers(data){
|
function RenderMarkers(data){
|
||||||
array.forEach(data => {
|
if (!Array.isArray(rows)) {
|
||||||
var marker = L.marker([data.X, data.Y]).addTo(map);
|
console.error('Erwarte ein Array, bekam:', rows);
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const x = Number(row.X);
|
||||||
|
const y = Number(row.Y);
|
||||||
|
if (!Number.isFinite(x) || !Number.isFinite(y)) return;
|
||||||
|
|
||||||
|
L.marker([y, x]) // [lat, lng] -> [Y, X]
|
||||||
|
.addTo(map)
|
||||||
|
.bindPopup(`<b>${row.Name ?? ''}</b>`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user