ruscomap/public/js/map.js

39 lines
776 B
JavaScript
Raw Normal View History

2024-06-30 22:56:19 +02:00
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()
}