Working map journey editor and blog journey editor
This commit is contained in:
5 files changed
+539
-403
No files matched your search
+17
-25
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user