routing shortcut

This commit is contained in:
vcoppe
2024-07-16 15:48:01 +02:00
parent 88d2d3d81c
commit d0d35468ea
3 changed files with 11 additions and 3 deletions

View File

@@ -88,7 +88,8 @@
previousOverlays,
distanceMarkers,
directionMarkers,
streetViewSource
streetViewSource,
routing
} = settings;
let undoDisabled = derived(canUndo, ($canUndo) => !$canUndo);
@@ -544,6 +545,9 @@
} else if (e.key === 'F4') {
$directionMarkers = !$directionMarkers;
e.preventDefault();
} else if (e.key === 'F5') {
$routing = !$routing;
e.preventDefault();
} else if (
e.key === 'ArrowRight' ||
e.key === 'ArrowDown' ||

View File

@@ -5,6 +5,7 @@
import { Button } from '$lib/components/ui/button';
import Help from '$lib/components/Help.svelte';
import Tooltip from '$lib/components/Tooltip.svelte';
import Shortcut from '$lib/components/Shortcut.svelte';
import {
Bike,
Footprints,
@@ -25,7 +26,6 @@
import { brouterProfiles, routingProfileSelectItem } from './Routing';
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { RoutingControls } from './RoutingControls';
import mapboxgl from 'mapbox-gl';
import { fileObservers } from '$lib/db';
@@ -129,7 +129,10 @@
</span>
<Switch class="scale-90" bind:checked={$routing} />
</Label>
<span slot="tooltip">{$_('toolbar.routing.use_routing_tooltip')}</span>
<span slot="tooltip" class="flex flex-row items-center">
{$_('toolbar.routing.use_routing_tooltip')}
<Shortcut key="F5" />
</span>
</Tooltip>
{#if $routing}
<div class="flex flex-col gap-3" in:slide>

View File

@@ -27,6 +27,7 @@ You can minimize the dialog to save space by clicking on <button><SquareArrowUpL
When routing is enabled, anchor points placed or moved on the map will be connected by a route calculated on the <a href="https://www.openstreetmap.org" target="_blank">OpenStreetMap</a> road network.
Disable routing to connect anchor points with straight lines.
This setting can also be toggled by pressing <kbd>F5</kbd>.
### <Bike size="16" class="inline-block" style="margin-bottom: 2px" /> Activity