diff --git a/assets/js/map.ts b/assets/js/map.ts index 950ee26..31ef11f 100644 --- a/assets/js/map.ts +++ b/assets/js/map.ts @@ -1132,6 +1132,23 @@ let MapAPRSMap = { // Handle marker click marker.on("click", () => { if (marker.openPopup) marker.openPopup(); + + // Bring the clicked marker to front + if (marker.getElement) { + const element = marker.getElement(); + if (element) { + // Find the highest z-index among all markers + let maxZIndex = 1000; + document.querySelectorAll('.leaflet-marker-icon').forEach((el) => { + const zIndex = parseInt((el as HTMLElement).style.zIndex || '0', 10); + if (zIndex > maxZIndex) maxZIndex = zIndex; + }); + + // Set this marker's z-index higher than all others + element.style.zIndex = (maxZIndex + 1).toString(); + } + } + safePushEvent(self.pushEvent, "marker_clicked", { id: data.id, callsign: data.callsign, diff --git a/lib/aprsme_web/aprs_symbol.ex b/lib/aprsme_web/aprs_symbol.ex index 5e78be7..a2b6882 100644 --- a/lib/aprsme_web/aprs_symbol.ex +++ b/lib/aprsme_web/aprs_symbol.ex @@ -290,7 +290,7 @@ defmodule AprsmeWeb.AprsSymbol do white-space: nowrap; border: 1px solid rgba(30, 64, 175, 0.3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); - pointer-events: none; + pointer-events: auto; z-index: 1000; ">#{callsign}