updates trail panel view
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { z, ZodType } from "zod";
|
||||
import type { Waypoint } from "../waypoint";
|
||||
import { icons } from "$lib/util/icon_util";
|
||||
|
||||
const WaypointCreateSchema = z.object({
|
||||
id: z.string().length(15).optional(),
|
||||
@@ -7,7 +8,8 @@ const WaypointCreateSchema = z.object({
|
||||
description: z.string().optional(),
|
||||
lat: z.number({coerce: true}).min(-90).max(90),
|
||||
lon: z.number({coerce: true}).min(-180).max(180),
|
||||
icon: z.string().optional(),
|
||||
distance_from_start: z.number({coerce: true}).min(0).optional(),
|
||||
icon: z.enum(icons).optional(),
|
||||
author: z.string().length(15),
|
||||
photos: z.array(z.string()).default([]),
|
||||
}) satisfies ZodType<Partial<Waypoint>>
|
||||
@@ -17,7 +19,8 @@ const WaypointUpdateSchema = z.object({
|
||||
description: z.string().optional(),
|
||||
lat: z.number({coerce: true}).min(-90).max(90).optional(),
|
||||
lon: z.number({coerce: true}).min(-180).max(180).optional(),
|
||||
icon: z.string().default("circle").optional(),
|
||||
distance_from_start: z.number({coerce: true}).min(0).optional(),
|
||||
icon: z.enum(icons).default("circle").optional(),
|
||||
photos: z.array(z.string()).optional(),
|
||||
"photos-": z.string().optional(),
|
||||
"photos+": z.string().optional(),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { icons } from "$lib/util/icon_util";
|
||||
import * as M from "maplibre-gl";
|
||||
|
||||
class Waypoint {
|
||||
@@ -6,14 +7,15 @@ class Waypoint {
|
||||
description?: string;
|
||||
lat: number;
|
||||
lon: number;
|
||||
icon?: string;
|
||||
distance_from_start?: number;
|
||||
icon?: typeof icons[number];
|
||||
marker?: M.Marker;
|
||||
photos: string[];
|
||||
_photos?: File[];
|
||||
author: string;
|
||||
|
||||
constructor(lat: number, lon: number, params?: {
|
||||
id?: string, name?: string, description?: string, icon?: string, marker?: M.Marker, photos?: string[];
|
||||
id?: string, name?: string, description?: string, icon?: typeof icons[number], marker?: M.Marker, photos?: string[];
|
||||
}) {
|
||||
this.id = params?.id;
|
||||
this.name = params?.name ?? "";
|
||||
|
||||
Reference in New Issue
Block a user