Dashboard overlay (Overlays → Live → Dashboard): one inclinometer (compass ring, roll and pitch), speed, the speed limit with an over-limit warning and, on the route, the next limit change, traffic signal, maneuver and its lanes; /api/route gains speed_limits, signals and lanes, POST /api/road gives the driven road's limit; GNSS simulation (random trips over Valhalla) for trying it without the car; the HMC5883L heading in can.json
This commit is contained in:
1 parent
5958ffd153
commit
190a8ad334
13 files changed
+713
-27
No files matched your search
@@ -112,3 +112,18 @@ export function editRoute(key, feature) {
|
||||
export function onRouteEdit(callback) {
|
||||
document.addEventListener(ROUTE_EDIT_EVENT, (event) => callback(event.detail));
|
||||
}
|
||||
|
||||
// The route the route panel shows (its /api/route Feature, or null when
|
||||
// cleared), for the dashboard's speed limits, signals and lanes ahead.
|
||||
const ROUTE_CHANGED_EVENT = "route-changed";
|
||||
let currentRoute = null;
|
||||
|
||||
export function notifyRouteChanged(route) {
|
||||
currentRoute = route;
|
||||
document.dispatchEvent(new CustomEvent(ROUTE_CHANGED_EVENT, { detail: route }));
|
||||
}
|
||||
|
||||
export function onRouteChanged(callback) {
|
||||
document.addEventListener(ROUTE_CHANGED_EVENT, (event) => callback(event.detail));
|
||||
return currentRoute;
|
||||
}
|
||||
Reference in new issue
Block a user