diff --git a/website/src/lib/components/gpx-layer/GPXLayer.ts b/website/src/lib/components/gpx-layer/GPXLayer.ts
index e7f9ea0d..4571c8a7 100644
--- a/website/src/lib/components/gpx-layer/GPXLayer.ts
+++ b/website/src/lib/components/gpx-layer/GPXLayer.ts
@@ -2,13 +2,14 @@ import { currentTool, Tool } from "$lib/stores";
import { settings, type GPXFileWithStatistics, dbUtils } from "$lib/db";
import { get, type Readable } from "svelte/store";
import mapboxgl from "mapbox-gl";
-import { currentWaypoint, waypointPopup } from "./WaypointPopup";
+import { currentPopupWaypoint, waypointPopup } from "./WaypointPopup";
import { addSelectItem, selectItem, selection } from "$lib/components/file-list/Selection";
import { ListTrackSegmentItem, ListWaypointItem, ListWaypointsItem, ListTrackItem, ListFileItem, ListRootItem } from "$lib/components/file-list/FileList";
import type { Waypoint } from "gpx";
import { produce } from "immer";
import { resetCursor, setCursor, setGrabbingCursor, setPointerCursor } from "$lib/utils";
import { font } from "$lib/assets/layers";
+import { selectedWaypoint } from "$lib/components/toolbar/tools/Waypoint.svelte";
let defaultWeight = 5;
let defaultOpacity = 0.6;
@@ -190,13 +191,14 @@ export class GPXLayer {
return;
}
- if ((e.shiftKey || e.ctrlKey || e.metaKey) && get(selection).hasAnyChildren(new ListWaypointsItem(this.fileId), false)) {
- addSelectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index));
+ if (get(verticalFileView)) {
+ if ((e.shiftKey || e.ctrlKey || e.metaKey) && get(selection).hasAnyChildren(new ListWaypointsItem(this.fileId), false)) {
+ addSelectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index));
+ } else {
+ selectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index));
+ }
} else {
- selectItem(new ListWaypointItem(this.fileId, marker._waypoint._data.index));
- }
- if (!get(verticalFileView) && !get(selection).has(new ListFileItem(this.fileId))) {
- addSelectItem(new ListFileItem(this.fileId));
+ selectedWaypoint.set([marker._waypoint, this.fileId]);
}
e.stopPropagation();
});
@@ -318,14 +320,14 @@ export class GPXLayer {
showWaypointPopup(waypoint: Waypoint) {
let marker = this.markers[waypoint._data.index];
if (marker) {
- currentWaypoint.set(waypoint);
+ currentPopupWaypoint.set(waypoint);
marker.setPopup(waypointPopup);
marker.togglePopup();
}
}
hideWaypointPopup() {
- let waypoint = get(currentWaypoint);
+ let waypoint = get(currentPopupWaypoint);
if (waypoint) {
let marker = this.markers[waypoint._data.index];
marker?.getPopup()?.remove();
diff --git a/website/src/lib/components/gpx-layer/WaypointPopup.svelte b/website/src/lib/components/gpx-layer/WaypointPopup.svelte
index 3ca03cfb..ce13f239 100644
--- a/website/src/lib/components/gpx-layer/WaypointPopup.svelte
+++ b/website/src/lib/components/gpx-layer/WaypointPopup.svelte
@@ -1,6 +1,6 @@
- {#if $currentWaypoint}
+ {#if $currentPopupWaypoint}
- {$currentWaypoint.name}
+ {$currentPopupWaypoint.name}
- {$currentWaypoint.getLatitude().toFixed(6)}° {$currentWaypoint
+ {$currentPopupWaypoint.getLatitude().toFixed(6)}° {$currentPopupWaypoint
.getLongitude()
.toFixed(6)}°
- {#if $currentWaypoint.ele !== undefined}
+ {#if $currentPopupWaypoint.ele !== undefined}
-
+
{/if}
- {#if $currentWaypoint.desc}
- {$currentWaypoint.desc}
+ {#if $currentPopupWaypoint.desc}
+ {$currentPopupWaypoint.desc}
{/if}
- {#if $currentWaypoint.cmt}
- {$currentWaypoint.cmt}
+ {#if $currentPopupWaypoint.cmt}
+ {$currentPopupWaypoint.cmt}
{/if}
diff --git a/website/src/lib/components/gpx-layer/WaypointPopup.ts b/website/src/lib/components/gpx-layer/WaypointPopup.ts
index 20578b25..8815fc51 100644
--- a/website/src/lib/components/gpx-layer/WaypointPopup.ts
+++ b/website/src/lib/components/gpx-layer/WaypointPopup.ts
@@ -2,7 +2,7 @@ import type { Waypoint } from "gpx";
import mapboxgl from "mapbox-gl";
import { writable } from "svelte/store";
-export const currentWaypoint = writable
(null);
+export const currentPopupWaypoint = writable(null);
export const waypointPopup = new mapboxgl.Popup({
closeButton: false,
diff --git a/website/src/lib/components/toolbar/Toolbar.svelte b/website/src/lib/components/toolbar/Toolbar.svelte
index 317adba6..062a13fb 100644
--- a/website/src/lib/components/toolbar/Toolbar.svelte
+++ b/website/src/lib/components/toolbar/Toolbar.svelte
@@ -8,7 +8,6 @@
SquareDashedMousePointer,
Ungroup,
MapPin,
- Palette,
Filter,
Scissors
} from 'lucide-svelte';
@@ -28,7 +27,7 @@
- {$_('toolbar.waypoint_tooltip')}
+ {$_('toolbar.waypoint.tooltip')}
diff --git a/website/src/lib/components/toolbar/tools/Waypoint.svelte b/website/src/lib/components/toolbar/tools/Waypoint.svelte
index 70693af2..176af149 100644
--- a/website/src/lib/components/toolbar/tools/Waypoint.svelte
+++ b/website/src/lib/components/toolbar/tools/Waypoint.svelte
@@ -1,40 +1,232 @@
-
-
- {#if waypoint}
-
{waypoint.name}
-
{waypoint.desc ?? ''}
-
{waypoint.cmt ?? ''}
- {/if}
+
+
+
+
+
+
+
+
+
+ {#if $selectedWaypoint || canCreate}
+ {$_('toolbar.waypoint.help')}
+ {:else}
+ {$_('toolbar.waypoint.help_no_selection')}
+ {/if}
+
diff --git a/website/src/lib/components/toolbar/tools/routing/Routing.svelte b/website/src/lib/components/toolbar/tools/routing/Routing.svelte
index b46c0f39..22371600 100644
--- a/website/src/lib/components/toolbar/tools/routing/Routing.svelte
+++ b/website/src/lib/components/toolbar/tools/routing/Routing.svelte
@@ -85,7 +85,6 @@
{/if}
{$_('toolbar.routing.use_routing')}
-
{$_('toolbar.routing.use_routing_tooltip')}
diff --git a/website/src/lib/components/ui/input/index.ts b/website/src/lib/components/ui/input/index.ts
new file mode 100644
index 00000000..75e3bc25
--- /dev/null
+++ b/website/src/lib/components/ui/input/index.ts
@@ -0,0 +1,29 @@
+import Root from "./input.svelte";
+
+export type FormInputEvent
= T & {
+ currentTarget: EventTarget & HTMLInputElement;
+};
+export type InputEvents = {
+ blur: FormInputEvent;
+ change: FormInputEvent;
+ click: FormInputEvent;
+ focus: FormInputEvent;
+ focusin: FormInputEvent;
+ focusout: FormInputEvent;
+ keydown: FormInputEvent;
+ keypress: FormInputEvent;
+ keyup: FormInputEvent;
+ mouseover: FormInputEvent;
+ mouseenter: FormInputEvent;
+ mouseleave: FormInputEvent;
+ mousemove: FormInputEvent;
+ paste: FormInputEvent;
+ input: FormInputEvent;
+ wheel: FormInputEvent;
+};
+
+export {
+ Root,
+ //
+ Root as Input,
+};
diff --git a/website/src/lib/components/ui/input/input.svelte b/website/src/lib/components/ui/input/input.svelte
new file mode 100644
index 00000000..58241375
--- /dev/null
+++ b/website/src/lib/components/ui/input/input.svelte
@@ -0,0 +1,42 @@
+
+
+
diff --git a/website/src/lib/components/ui/textarea/index.ts b/website/src/lib/components/ui/textarea/index.ts
new file mode 100644
index 00000000..6eb6ba34
--- /dev/null
+++ b/website/src/lib/components/ui/textarea/index.ts
@@ -0,0 +1,28 @@
+import Root from "./textarea.svelte";
+
+type FormTextareaEvent = T & {
+ currentTarget: EventTarget & HTMLTextAreaElement;
+};
+
+type TextareaEvents = {
+ blur: FormTextareaEvent;
+ change: FormTextareaEvent;
+ click: FormTextareaEvent;
+ focus: FormTextareaEvent;
+ keydown: FormTextareaEvent;
+ keypress: FormTextareaEvent;
+ keyup: FormTextareaEvent;
+ mouseover: FormTextareaEvent;
+ mouseenter: FormTextareaEvent;
+ mouseleave: FormTextareaEvent;
+ paste: FormTextareaEvent;
+ input: FormTextareaEvent;
+};
+
+export {
+ Root,
+ //
+ Root as Textarea,
+ type TextareaEvents,
+ type FormTextareaEvent,
+};
diff --git a/website/src/lib/components/ui/textarea/textarea.svelte b/website/src/lib/components/ui/textarea/textarea.svelte
new file mode 100644
index 00000000..d786257e
--- /dev/null
+++ b/website/src/lib/components/ui/textarea/textarea.svelte
@@ -0,0 +1,38 @@
+
+
+
diff --git a/website/src/locales/en.json b/website/src/locales/en.json
index 92b3a318..74d5063c 100644
--- a/website/src/locales/en.json
+++ b/website/src/locales/en.json
@@ -130,7 +130,18 @@
"help_cannot_merge_contents": "Your selection needs to contain several file items to merge their contents"
},
"extract_tooltip": "Extract contents",
- "waypoint_tooltip": "Create and edit points of interest",
+ "waypoint": {
+ "tooltip": "Create and edit points of interest",
+ "name": "Name",
+ "description": "Description",
+ "comment": "Comment",
+ "longitude": "Longitude",
+ "latitude": "Latitude",
+ "create": "Create",
+ "update": "Update",
+ "help": "Fill in the form to create a new point of interest, or click on an existing one to edit it. Click on the map to fill the coordinates, or drag points of interest to move them.",
+ "help_no_selection": "Select a file item to create or edit points of interest"
+ },
"reduce": {
"tooltip": "Reduce the number of GPS points",
"tolerance": "Tolerance",