diff --git a/docs/architecture.adoc b/docs/architecture.adoc index fdfa8ff..d636e3d 100644 --- a/docs/architecture.adoc +++ b/docs/architecture.adoc @@ -251,6 +251,16 @@ Locate fall back to the browser's own mechanism — with its own toggle/marker/recentering-per-fix, since that's the one case this control does own the tracking itself; clicking again in that case stops the watch and removes the marker. +Deliberately *not* `.gnss-marker` (`GnssControl`'s green dot) for that +marker — reusing it for a browser-estimated position too made it look +like this control was somehow still using GNSS data even when it very +much wasn't (a real report from testing this: a browser's own +location, wifi/IP-estimated on a machine with no GPS chip, can jump +around noticeably between updates, and a green dot doing that reads +as "the GNSS simulator, leaking somehow"). Uses MapLibre's own blue +pulsing `.maplibregl-user-location-dot` (`maplibre-gl.css`) instead — +the same look GeolocateControl itself had here before, and visually +distinct from GNSS's green on purpose. === Debug inspector (Alt+click) diff --git a/public/js/locate.js b/public/js/locate.js index ff382aa..87fd68e 100644 --- a/public/js/locate.js +++ b/public/js/locate.js @@ -89,10 +89,17 @@ export class LocateControl { // first fix, since that's the one jumping from wherever the map already // was; easeTo for later updates, a plain pan/zoom-preserving follow // rather than repeating that same swoop on every update. + // + // MapLibre's own blue pulsing "user location" dot styling + // (.maplibregl-user-location-dot, maplibre-gl.css — the exact look + // GeolocateControl itself used here before), not GnssControl's green + // .gnss-marker — reusing that green for a browser-estimated position too + // looked like this control was somehow still using GNSS data even when + // it very much wasn't; distinct colors for distinct sources. _setPosition(lon, lat) { if (!this._marker) { const el = document.createElement("div"); - el.className = "gnss-marker"; + el.className = "maplibregl-user-location-dot"; this._marker = new Marker({ element: el }).setLngLat([lon, lat]).addTo(this._map); this._map.flyTo({ center: [lon, lat], zoom: Math.max(this._map.getZoom(), 15) }); } else {