adds maplibre for new routes

This commit is contained in:
Christian Beutel
2024-11-28 19:35:59 +01:00
parent b6b409e855
commit aea4e26084
7 changed files with 201 additions and 112 deletions

View File

@@ -1,4 +1,4 @@
import type { LatLng, Marker } from "leaflet";
import * as M from "maplibre-gl";
interface ValhallaRouteResponse {
trip: {
@@ -16,7 +16,7 @@ interface ValhallaAnchor {
id: string,
lat: number,
lon: number,
marker?: Marker
marker?: M.Marker
}
export { type ValhallaRouteResponse, type ValhallaHeightResponse, type ValhallaAnchor }
export { type ValhallaAnchor, type ValhallaHeightResponse, type ValhallaRouteResponse };

View File

@@ -1,4 +1,5 @@
import type { Marker } from "leaflet";
import type { Marker } from "maplibre-gl";
import * as M from "maplibre-gl";
import { number, object, string } from "yup";
class Waypoint {
@@ -8,13 +9,13 @@ class Waypoint {
lat: number;
lon: number;
icon?: string;
marker?: Marker;
marker?: M.Marker;
photos: string[];
_photos: File[];
author?: string;
constructor(lat: number, lon: number, params?: {
id?: string, name?: string, description?: string, icon?: string, marker?: Marker, photos?: string[];
id?: string, name?: string, description?: string, icon?: string, marker?: M.Marker, photos?: string[];
}) {
this.id = params?.id;
this.name = params?.name ?? "";