39 lines
776 B
JavaScript
39 lines
776 B
JavaScript
|
import { initMarkers } from "./markerHandler.js";
|
||
|
import { initEvents } from "./eventHandler.js";
|
||
|
import { mapInit } from "./mapInit.js";
|
||
|
|
||
|
const markerPopupExample = [
|
||
|
{
|
||
|
title: "Title test",
|
||
|
description: "Description test",
|
||
|
imgName: "imgTest.jpg",
|
||
|
x: 44.49385,
|
||
|
y: 11.34316,
|
||
|
},
|
||
|
{
|
||
|
title: "Title 1test",
|
||
|
description: "Description 1test",
|
||
|
imgName: "imgTest1.jpg",
|
||
|
x: 44.49385,
|
||
|
y: 11.40,
|
||
|
}
|
||
|
]
|
||
|
|
||
|
let editMode = false
|
||
|
|
||
|
let map = mapInit()
|
||
|
|
||
|
initMarkers(markerPopupExample, L, map);
|
||
|
|
||
|
initEvents(map)
|
||
|
|
||
|
setInterval(fetchNewMarkers, 5000)
|
||
|
|
||
|
async function fetchNewMarkers() {
|
||
|
let reponse = await fetch('/fetchMarkers', {
|
||
|
method: 'GET',
|
||
|
})
|
||
|
return await response.json()
|
||
|
}
|
||
|
|