fix_temp_mrk_date

This commit is contained in:
scossa 2024-08-22 18:26:33 +02:00
parent b8fdb75310
commit c811b4eb4e
2 changed files with 5 additions and 3 deletions

View file

@ -61,12 +61,13 @@ export function initEvents(map) {
noticeCoordsPicker.style.display = 'none';
remainingForm.style.display = 'block';
map.getContainer().style.cursor = 'auto';
const formattedDate = new Date().toISOString();
const tmpMarker = {
coordinate: { x: formInputCoordX.value, y: formInputCoordY.value },
name: "",
description: "Compila il form per aggiungere un marker qui. Oppure annulla l'inserimento del marker cliccando sulla X in alto a destra",
filename: "../img/trashw.png",
ts: Date.now().toString(),
ts: formattedDate,
}
tmpMarkerSet = createMarker(tmpMarker, L, map, true)
isTmpMarkerSet = true

View file

@ -15,8 +15,9 @@ export function createMarker(markerData, L, map, returnMarker = false){
let popUpContentTitle = "<h1>"+ markerData.name +"</h1>";
let popUpContentdescription = "<p>"+ markerData.description +"</p>";
let popUpContentImage = "<img src='/imgs/"+ markerData.filename +"'</img>";
let popUpContentDate = "<br><p>Inserito il: " + markerData.ts.substring(0, 10) + "<br>alle " + markerData.ts.substring(11, 16) + "</p>";
let popUpContent = popUpContentTitle + popUpContentdescription + popUpContentImage + popUpContentDate
let popUpContentDate = "<br><p>Inserito il: " + markerData.ts.substring(0, 10) + "<br>alle: " + markerData.ts.substring(11, 16) + "</p>";
//let popUpContentHour = "<p>" + "alle: " + markerData.ts.substring(11, 16) + "</p>";
let popUpContent = popUpContentTitle + popUpContentdescription + popUpContentImage + popUpContentDate //+ popUpContentHour
marker.bindPopup(popUpContent);
if(returnMarker) {
return marker;