add routing docs

This commit is contained in:
vcoppe
2024-07-09 22:15:05 +02:00
parent afe14b2537
commit e174d4d2f5
20 changed files with 121 additions and 21 deletions

View File

@@ -16,7 +16,7 @@
import ToolbarItemMenu from './ToolbarItemMenu.svelte';
</script>
<div class="flex flex-row w-full items-center">
<div class="flex flex-row w-full items-center pr-12">
<div
class="h-fit flex flex-col p-1 gap-1.5 bg-background rounded-r-md pointer-events-auto shadow-md"
>

View File

@@ -127,7 +127,7 @@
$: validSelection = $selection.size > 0;
</script>
<div class="flex flex-col gap-3 w-80">
<div class="flex flex-col gap-3 w-full max-w-80 items-center">
<fieldset class="flex flex-col gap-3">
<Label class="flex flex-row items-center gap-[6.4px] h-3">
<Checkbox bind:checked={deleteTrackpoints} class="scale-90" />
@@ -150,6 +150,7 @@
</fieldset>
<Button
variant="outline"
class="w-full"
disabled={!validSelection || rectangleCoordinates.length != 2}
on:click={() => {
dbUtils.cleanSelection(

View File

@@ -37,7 +37,7 @@
});
</script>
<div class="flex flex-col gap-3 w-80">
<div class="flex flex-col gap-3 w-full max-w-80">
<Button variant="outline" disabled={!validSelection} on:click={dbUtils.extractSelection}>
<Ungroup size="16" class="mr-1" />
{$_('toolbar.extract.button')}

View File

@@ -52,7 +52,7 @@
let mergeType = MergeType.TRACES;
</script>
<div class="flex flex-col gap-3 w-80">
<div class="flex flex-col gap-3 w-full max-w-80">
<RadioGroup.Root bind:value={mergeType}>
<Label class="flex flex-row items-center gap-2 leading-5">
<RadioGroup.Item value={MergeType.TRACES} />

View File

@@ -147,7 +147,7 @@
}
</script>
<div class="flex flex-col gap-3 w-80">
<div class="flex flex-col gap-3 w-full max-w-80">
<div class="p-2">
<Slider bind:value={sliderValue} min={0} max={100} step={1} />
</div>

View File

@@ -76,7 +76,7 @@
});
</script>
<div class="flex flex-col gap-3 w-80">
<div class="flex flex-col gap-3 w-full max-w-80">
<div class="p-2">
<Slider bind:value={sliderValues} max={maxSliderValue} step={1} disabled={!validSelection} />
</div>

View File

@@ -162,7 +162,7 @@
});
</script>
<div class="flex flex-col gap-3 w-96">
<div class="flex flex-col gap-3 w-full max-w-96">
<fieldset class="flex flex-col gap-2">
<Label for="name">{$_('menu.metadata.name')}</Label>
<Input bind:value={name} id="name" class="font-semibold h-8" />

View File

@@ -102,7 +102,10 @@
</Button>
</div>
{:else}
<div class="flex flex-col gap-3 w-80" in:flyAndScale={{ x: -2, y: 0, duration: 50 }}>
<div
class="flex flex-col gap-3 w-full max-w-80 {$$props.class ?? ''}"
in:flyAndScale={{ x: -2, y: 0, duration: 50 }}
>
<div class="grow flex flex-col gap-3">
<Tooltip>
<Label slot="data" class="w-full flex flex-row justify-between items-center gap-2">

View File

@@ -2,7 +2,7 @@ import type { Coordinates } from "gpx";
import { TrackPoint, distance } from "gpx";
import { derived, get, writable } from "svelte/store";
import { settings } from "$lib/db";
import { _, locale } from "svelte-i18n";
import { _, isLoading, locale } from "svelte-i18n";
import { map } from "$lib/stores";
const { routing, routingProfile, privateRoads } = settings;
@@ -17,12 +17,12 @@ export const brouterProfiles: { [key: string]: string } = {
railway: 'rail'
};
export const routingProfileSelectItem = writable({
value: 'bike',
value: '',
label: ''
});
derived([routingProfile, locale], ([profile, l]) => [profile, l]).subscribe(([profile, l]) => {
if (profile !== get(routingProfileSelectItem).value && l !== null) {
derived([routingProfile, locale, isLoading], ([profile, l, i]) => [profile, l, i]).subscribe(([profile, l, i]) => {
if (!i && profile !== get(routingProfileSelectItem).value && l !== null) {
routingProfileSelectItem.update((item) => {
item.value = profile;
item.label = get(_)(`toolbar.routing.activities.${profile}`);