Working map journey editor and blog journey editor

This commit is contained in:
Josh-Dev-Quest committed 2026-03-28 19:28:42 +01:00
1 parent 0de91bf814
commit a9ab42eda5
5 files changed
+539 -403

No files matched your search

+17 -25
View File
@@ -1009,41 +1009,33 @@
activeMarker = null;
}
function saveMarker() {
async function saveMarker() {
if (!activeMarker) return;
const title =
document.getElementById("marker-title").value ||
"Untitled";
const title = document.getElementById("marker-title").value || "Untitled";
const date = document.getElementById("marker-date").value;
const description =
document.getElementById("marker-text").value;
const description = document.getElementById("marker-text").value;
const videoUrl = document.getElementById("video-url").value;
activeMarker.setTitle(title);
// Update marker's tooltip title and popup
activeMarker.options.title = title;
activeMarker.setPopupContent(`<strong>${title}</strong>`);
activeMarker._content = {
title,
date,
description,
videoUrl,
};
// Store content for saving
activeMarker._content = { title, date, description, videoUrl };
// Update the list item in the sidebar
const latlng = activeMarker.getLatLng();
const items = document.querySelectorAll(
"#current-markers-container .marker-item",
);
const items = document.querySelectorAll("#current-markers-container .marker-item");
for (let item of items) {
if (
item.dataset.lat == latlng.lat &&
item.dataset.lng == latlng.lng
) {
item.querySelector(".marker-title").textContent =
title;
if (item.dataset.lat == latlng.lat && item.dataset.lng == latlng.lng) {
item.querySelector(".marker-title").textContent = title;
break;
}
}
closeModal();
showToast("Marker updated");
showToast("Saving journey...");
await saveJourneyToAPI();
}
function deleteMarkerFromMap() {