mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-06 02:12:55 +00:00
delete waypoint
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { dbUtils } from "$lib/db";
|
||||
import type { Waypoint } from "gpx";
|
||||
import mapboxgl from "mapbox-gl";
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
export const currentPopupWaypoint = writable<Waypoint | null>(null);
|
||||
export const currentPopupWaypoint = writable<[Waypoint, string] | null>(null);
|
||||
|
||||
export const waypointPopup = new mapboxgl.Popup({
|
||||
closeButton: false,
|
||||
maxWidth: undefined
|
||||
});
|
||||
});
|
||||
|
||||
export function deleteWaypoint(fileId: string, waypointIndex: number) {
|
||||
dbUtils.applyToFile(fileId, (file) => file.replaceWaypoints(waypointIndex, waypointIndex, [])[0]);
|
||||
}
|
Reference in New Issue
Block a user