From 1d39bec4dda838281a52df19a70b3bedc5eeec15 Mon Sep 17 00:00:00 2001 From: Nicole Date: Sat, 15 Nov 2025 23:45:15 +0100 Subject: [PATCH] Added GPS markers and teardrop effects --- src/map-badge-v2.html | 80 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/src/map-badge-v2.html b/src/map-badge-v2.html index 946c9e8..9f62ffc 100644 --- a/src/map-badge-v2.html +++ b/src/map-badge-v2.html @@ -14,7 +14,51 @@ .custom-marker-wrapper { position: relative; width: 48px; - height: 48px; + height: 62px; /* Increased to accommodate pointer shape */ + display: flex; + flex-direction: column; + align-items: center; + } + + .custom-marker-position-circle { + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 16px; + height: 16px; + border-radius: 50%; + box-shadow: 0 2px 4px rgba(0,0,0,0.3); + z-index: 1; + } + + .custom-marker-profile-wrapper { + position: absolute; + top: 0; + left: 0; + width: 48px; + height: 54px; + z-index: 2; + } + + .custom-marker-image-container { + width: 48px; + height: 54px; + position: relative; + } + + .custom-marker-image-container::after { + content: ''; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 0; + height: 0; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 8px solid var(--border-color, #757575); + z-index: 1; } .custom-marker-image { @@ -36,6 +80,7 @@ font-size: 12px; color: white; box-shadow: 0 1px 3px rgba(0,0,0,0.3); + z-index: 3; } #refresh-button { @@ -255,14 +300,19 @@ function createMarkerHTML(personState, activityState, pictureUrl) { return `
- -
- +
+
+ +
+
+ +
+
`; } @@ -309,9 +359,9 @@ function updateMarkerOSM(entityId, data, lat, lon, personState, activityState, p markers[entityId].setIcon(L.divIcon({ className: 'custom-leaflet-marker', html: iconHtml, - iconSize: [48, 48], - iconAnchor: [24, 48], - popupAnchor: [0, -48] + iconSize: [48, 62], + iconAnchor: [24, 62], + popupAnchor: [0, -62] })); } else { // Create new marker @@ -319,9 +369,9 @@ function updateMarkerOSM(entityId, data, lat, lon, personState, activityState, p const icon = L.divIcon({ className: 'custom-leaflet-marker', html: iconHtml, - iconSize: [48, 48], - iconAnchor: [24, 48], - popupAnchor: [0, -48] + iconSize: [48, 62], + iconAnchor: [24, 62], + popupAnchor: [0, -62] }); const marker = L.marker([lat, lon], { icon: icon }).addTo(map); @@ -386,7 +436,7 @@ function updateMarkerGoogle(entityId, data, lat, lon, personState, activityState const div = this.div; div.style.left = (pos.x - 24) + 'px'; // Center horizontally (48px / 2) - div.style.top = (pos.y - 48) + 'px'; // Position above point + div.style.top = (pos.y - 62) + 'px'; // Position above point (62px total height) } onRemove() {