Terrain closes by itself again: the road's surface only off the route (back on it the last road's stayed, so the view never closed); while it's open the top row's Limit shows the surface. Navigated, the planned route behind the car thin and dashed under the trip log's track (the line and its casing clear there). The scale back over the map, bottom left. CAN recordings older than CAN_REC_KEEP_HOURS (24 by default, 0 keeps all) deleted when listed and every segment while recording. TODO tidied
This commit is contained in:
1 parent
21ad6c0c21
commit
f981b80599
9 files changed
+80
-34
No files matched your search
@@ -43,11 +43,13 @@ const NOT_YET = new Set();
|
||||
// TILT_DEG for TILT_S; back to the road view after PAVED_BACK_M on paved road.
|
||||
// Closed by hand while still off-road: not again until back on the road.
|
||||
const UNPAVED = new Set(["compacted", "dirt", "gravel", "path", "impassable"]);
|
||||
// Valhalla's surfaces, shown in place of the limit while the terrain view is open
|
||||
const SURFACES = { paved_smooth: "Paved", paved: "Paved", paved_rough: "Rough", compacted: "Compacted", dirt: "Dirt", gravel: "Gravel", path: "Track", impassable: "Impassable" };
|
||||
const TILT_DEG = 10;
|
||||
const TILT_S = 10;
|
||||
const PAVED_BACK_M = 2000;
|
||||
const TERRAIN_AUTO_KEY = "maptool.terrainAuto";
|
||||
const FIELDS = { speed: "Speed", limit: "Limit", altitude: "Altitude", time: "Time", sun: "Sun", nextStop: "Next stop",
|
||||
const FIELDS = { speed: "Speed", limit: "Limit", surface: "Surface", altitude: "Altitude", time: "Time", sun: "Sun", nextStop: "Next stop",
|
||||
toNextStop: "To next stop", etaNextStop: "ETA next stop", toEnd: "To the end" };
|
||||
const CARDINALS = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"];
|
||||
|
||||
@@ -422,6 +424,8 @@ export function setupDriving(map, nightButton, routePanel, gpxPanel) {
|
||||
const next = nav?.next ? `· ${typeof nav.next.limit === "number" ? nav.next.limit : "∞"} in ${distance(nav.next.m)}` : "";
|
||||
return [typeof limit === "number" ? limit : limit === "unlimited" ? "∞" : "—", next, "drive-cell--limit"];
|
||||
}
|
||||
case "surface":
|
||||
return [SURFACES[dash?.surface] || "—", dash?.surface ? "" : "unknown", UNPAVED.has(dash?.surface) ? "drive-terrain--caution" : ""];
|
||||
case "altitude":
|
||||
return [v.alt == null ? "—" : Math.round(v.alt), "m"];
|
||||
case "time":
|
||||
@@ -490,8 +494,9 @@ export function setupDriving(map, nightButton, routePanel, gpxPanel) {
|
||||
const a = ahead();
|
||||
for (const { cell, el } of cells) {
|
||||
if (cell.widget === "field") {
|
||||
const [value, unit, cls = ""] = fieldValue(cell.value, a);
|
||||
el.innerHTML = `<span class="drive-cell__label">${FIELDS[cell.value] || cell.value}</span><span class="drive-cell__value ${cls}">${escapeHtml(value)} <small>${escapeHtml(unit)}</small></span>`;
|
||||
const name = cell.value === "limit" && openPanel === terrain.el ? "surface" : cell.value; // off-road the surface matters, not the limit
|
||||
const [value, unit, cls = ""] = fieldValue(name, a);
|
||||
el.innerHTML = `<span class="drive-cell__label">${FIELDS[name] || name}</span><span class="drive-cell__value ${cls}">${escapeHtml(value)} <small>${escapeHtml(unit)}</small></span>`;
|
||||
} else if (cell.widget === "maneuver") renderManeuver(el);
|
||||
else if (cell.widget === "status") {
|
||||
el.innerHTML = `<b class="drive-status__brand">MAPTOOL</b><span class="drive-cell__muted"><span class="${navigator.onLine ? "drive-status--ok" : ""}">●</span> ${navigator.onLine ? "online" : "offline"}${log?.active ? ` · <span class="drive-status--rec">● rec</span>` : ""}</span>`;
|
||||
|
||||
Reference in new issue
Block a user