diff --git a/situation.php b/situation.php index 1e85110..083c4d5 100644 --- a/situation.php +++ b/situation.php @@ -165,6 +165,13 @@ } .sit-zone-label::before { display: none; } + /* GH #74 -- live-GPS layer-control legend dot. A CSS class rather + than an inline style="" so the colour can be overridden by a + stylesheet (the project's UI-consistency audit flags inline hex + colours specifically because no stylesheet can win against them + without !important; a class does not have that problem). */ + .sit-legend-live-gps { color: #fd7e14; } + /* Collapse toggle icon */ .sit-toggle { cursor: pointer; user-select: none; } .sit-toggle .bi { transition: transform 0.2s; } @@ -2049,6 +2056,28 @@ function init() { } }); tracker.start(); + + // GH #71 follow-up (cbyrdmo, 2026-08-17) — the live-GPS tracking + // overlay was added straight to the map (UnitTracking.init does + // L.layerGroup().addTo(map)) and never registered in the layer + // control. The "Units (EOC)" checkbox only governs the status- + // coloured EOC roster layer (unitMarkers), so switching units off + // left the live-GPS markers on screen — drawn in each unit's + // configured tracking colour (e.g. orange) rather than the green + // status colour — and operators read that as "units won't turn + // off." Register the tracking group as its own toggleable overlay + // (default on, unchanged) so it can be hidden, and persist that + // choice per-user like the other overlays. + if (sitLayersControl && typeof tracker.getLayerGroup === 'function') { + var liveGpsLayer = tracker.getLayerGroup(); + if (liveGpsLayer) { + sitLayersControl.addOverlay(liveGpsLayer, + ' Units — live GPS'); + if (window.MapLayerPrefs && window.MapLayerPrefs.register) { + window.MapLayerPrefs.register(map, 'units_live', liveGpsLayer); + } + } + } } // Fallback polling every 15s for incidents (SSE handles real-time when available) diff --git a/tests/test_gh71_live_gps_layer_toggle.php b/tests/test_gh71_live_gps_layer_toggle.php new file mode 100644 index 0000000..4fc4b43 --- /dev/null +++ b/tests/test_gh71_live_gps_layer_toggle.php @@ -0,0 +1,72 @@ +