What's here on a right click / long press / Alt+click (the Design canvas' Desktop): the position on top (a click copies it, with the DMS and the ground's height), Route here / Add to the trip / Save a point, the features' raw properties folded under it; C copies the position under the mouse. Voice prompts while navigating (speechSynthesis, Valhalla's verbal alert and pre-transition instructions, ~25 s and ~7 s ahead), on/off in drive mode's Menu, off by default. TODO: the touch items closed (the Pad7 is fine as it is)
This commit is contained in:
1 parent
f15fbef746
commit
ad975bcf62
8 files changed
+134
-36
No files matched your search
+11
-1
@@ -3,7 +3,7 @@ import { requestGnssFollow, onRouteChanged } from "/js/panels.js";
|
||||
import { pauseFollow, resumeFollow, isFollowing } from "/js/gnss.js";
|
||||
import { formatDuration } from "/js/route.js";
|
||||
import { isLoggedIn } from "/js/auth.js";
|
||||
import { watchDashboard, maneuverSvg, distance } from "/js/dashboard.js";
|
||||
import { watchDashboard, maneuverSvg, distance, VOICE_KEY } from "/js/dashboard.js";
|
||||
import { formatSunInfo } from "/js/sun.js";
|
||||
import { pointsMenu, layersMenu, terrainMenu, elevationHtml, cellButton, bindKey, emptyRow as empty, escapeHtml } from "/js/drive_menus.js";
|
||||
|
||||
@@ -104,6 +104,7 @@ export function setupDriving(map, nightButton, routePanel, gpxPanel) {
|
||||
<button type="button" class="drive-panel__close" aria-label="Close">✕</button>
|
||||
<button type="button" class="drive-menu__row" data-action="overview">The whole route <small>the follow pauses</small></button>
|
||||
<button type="button" class="drive-menu__row" data-action="terrain-auto"></button>
|
||||
<button type="button" class="drive-menu__row" data-action="voice"></button>
|
||||
<button type="button" class="drive-menu__row" data-action="leave">Leave driving mode</button>`;
|
||||
// auto: opens off-road and closes back on the road; stay: opens and stays (the inclinometer all along); hand: neither
|
||||
const TERRAIN_MODES = { auto: "opens and closes by itself", stay: "opens by itself, stays", hand: "by hand" };
|
||||
@@ -117,6 +118,15 @@ export function setupDriving(map, nightButton, routePanel, gpxPanel) {
|
||||
renderAuto();
|
||||
});
|
||||
renderAuto();
|
||||
const voiceButton = menuPanel.querySelector('[data-action="voice"]');
|
||||
const voiceOn = () => { try { return localStorage.getItem(VOICE_KEY) === "on"; } catch { return false; } };
|
||||
const renderVoice = () => { voiceButton.innerHTML = `Voice prompts: ${voiceOn() ? "on" : "off"} <small>tap to switch</small>`; };
|
||||
voiceButton.addEventListener("click", () => {
|
||||
try { localStorage.setItem(VOICE_KEY, voiceOn() ? "off" : "on"); } catch { /* private window: not kept */ }
|
||||
if (voiceOn()) window.speechSynthesis?.speak(new SpeechSynthesisUtterance("Voice prompts on"));
|
||||
renderVoice();
|
||||
});
|
||||
renderVoice();
|
||||
menuPanel.querySelector('[data-action="overview"]').addEventListener("click", overview);
|
||||
menuPanel.querySelector('[data-action="leave"]').addEventListener("click", () => set(false));
|
||||
const crosshair = document.createElement("div");
|
||||
|
||||
Reference in new issue
Block a user