Navigation: rerouting off the route (30 m for 3 fixes, HDOP ≤ 5, every 15 s at most) from the position to the points not reached yet; lanes as SVG arrows, the ones to take bold; dashboard background see-through with a slider; the GNSS simulation starts at a random place in the offline countries, the map jumping there
This commit is contained in:
1 parent
fbccb2acc9
commit
5f4c7c6ee8
9 files changed
+176
-35
No files matched your search
+10
-1
@@ -1,6 +1,6 @@
|
||||
import { Marker } from "/vendor/maplibre-gl/maplibre-gl.mjs";
|
||||
import { ROUTE_ICON, POSITION_ICON, SAVED_POINT_ICON, REVERSE_ICON, CLEAR_ICON, SAVE_ICON } from "/js/icons.js";
|
||||
import { notifySidePanelOpen, onlyOneSidePanelOpen, notifyGpxStoreChanged, onRoutePoint, onRouteEdit, notifyRouteChanged } from "/js/panels.js";
|
||||
import { notifySidePanelOpen, onlyOneSidePanelOpen, notifyGpxStoreChanged, onRoutePoint, onRouteEdit, notifyRouteChanged, onReroute } from "/js/panels.js";
|
||||
import { isLoggedIn } from "/js/auth.js";
|
||||
import { wirePreview } from "/js/preview.js";
|
||||
import { elevationAt } from "/js/dem.js";
|
||||
@@ -41,6 +41,15 @@ export class RoutePanelControl {
|
||||
this._request = 0; // so a slow older response can't overwrite a newer one
|
||||
this._editing = null; // { key, id, name } of a saved route being edited
|
||||
|
||||
// Rerouting (the dashboard, off the route): the start and the via points
|
||||
// already passed give way to the current position.
|
||||
onReroute(({ from, passed }) => {
|
||||
if (this._points.length < 2) return;
|
||||
this._points.splice(0, 1 + passed).forEach((p) => p.marker.remove());
|
||||
this._addPoint(from, "My position", { quiet: true });
|
||||
this._points.unshift(this._points.pop());
|
||||
this._changed();
|
||||
});
|
||||
onRoutePoint(({ lngLat, name }) => {
|
||||
this._setOpen(true);
|
||||
this._addPoint(lngLat, name);
|
||||
|
||||
Reference in new issue
Block a user