more route drawing

This commit is contained in:
Christian Beutel
2024-04-23 16:11:49 +02:00
parent 8a3894106f
commit b3ed2b1098
10 changed files with 261 additions and 98 deletions

View File

@@ -2,16 +2,21 @@ import GPX from "$lib/models/gpx/gpx";
import type Track from "$lib/models/gpx/track";
import TrackSegment from "$lib/models/gpx/track-segment";
import Waypoint from "$lib/models/gpx/waypoint";
import { type ValhallaHeightResponse, type ValhallaRouteResponse } from "$lib/models/valhalla";
import { type ValhallaAnchor, type ValhallaHeightResponse, type ValhallaRouteResponse } from "$lib/models/valhalla";
import { ClientResponseError } from "pocketbase";
const emtpyTrack: Track = { trkseg: [] }
export let route: GPX = new GPX({ trk: [emtpyTrack] });
export let anchors: ValhallaAnchor[] = [];
export function clearRoute() {
route = new GPX({ trk: [emtpyTrack] });
anchors = [];
}
export function setRoute(newRoute: GPX) {
route = newRoute
}
export async function calculateRouteBetween(startLat: number, startLon: number, endLat: number, endLon: number) {