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

View File

@@ -5,6 +5,7 @@
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import Help from '$lib/components/Help.svelte'; import Help from '$lib/components/Help.svelte';
import Tooltip from '$lib/components/Tooltip.svelte'; import Tooltip from '$lib/components/Tooltip.svelte';
import Shortcut from '$lib/components/Shortcut.svelte';
import { import {
Bike, Bike,
Footprints, Footprints,
@@ -25,7 +26,6 @@
import { brouterProfiles, routingProfileSelectItem } from './Routing'; import { brouterProfiles, routingProfileSelectItem } from './Routing';
import { _ } from 'svelte-i18n'; import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { RoutingControls } from './RoutingControls'; import { RoutingControls } from './RoutingControls';
import mapboxgl from 'mapbox-gl'; import mapboxgl from 'mapbox-gl';
import { fileObservers } from '$lib/db'; import { fileObservers } from '$lib/db';
@@ -129,7 +129,10 @@
</span> </span>
<Switch class="scale-90" bind:checked={$routing} /> <Switch class="scale-90" bind:checked={$routing} />
</Label> </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> </Tooltip>
{#if $routing} {#if $routing}
<div class="flex flex-col gap-3" in:slide> <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. 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. 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 ### <Bike size="16" class="inline-block" style="margin-bottom: 2px" /> Activity