From 69ec5436f8f4264cf542be913e45f5411f26bd51 Mon Sep 17 00:00:00 2001 From: Legonzaur Date: Mon, 13 Jul 2026 18:22:58 +0200 Subject: [PATCH] feat: plan trip --- app/components/map/map.client.vue | 49 ++++++++++++++++++++ app/components/sidebar/lines.vue | 16 +++---- app/components/sidebar/trip.vue | 11 ++--- app/layouts/default.vue | 47 ++++++++++++++++++- app/pages/index.vue | 4 +- app/pages/trip.vue | 37 ++++++++++++--- app/stores/mreso.ts | 6 +++ app/types.d.ts | 76 +++++++++++++++++++++++++++++++ app/utils/trip.ts | 2 +- package-lock.json | 7 +++ package.json | 1 + 11 files changed, 228 insertions(+), 28 deletions(-) diff --git a/app/components/map/map.client.vue b/app/components/map/map.client.vue index 57cf199..a89a794 100644 --- a/app/components/map/map.client.vue +++ b/app/components/map/map.client.vue @@ -10,6 +10,23 @@ :clusters="shownClusters" :route="r.route" /> + + + + @@ -22,18 +39,38 @@ import type { Point, } from "geojson"; +const paint = { + "line-color": "#FF0000", + "line-width": 4, +}; + import { useMap } from "@indoorequal/vue-maplibre-gl"; import { LngLat, LngLatBounds } from "maplibre-gl"; const style = "https://tiles.versatiles.org/assets/styles/colorful/style.json"; +// const style = +// "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json"; const center = new LngLat(5.735, 45.185); const zoom = 12; +const emit = defineEmits<{ + loaded: []; +}>(); + const store = useMresoStore(); await store.fetchData(); const shownClusters = ref | null>(null); const image = useSvgImage(); const map = useMap("main"); +watchEffect(() => { + console.log(store.selectedTrip); +}); + +watch(map, () => { + if (map.isLoaded) { + emit("loaded"); + } +}); watchEffect(async () => { const allClusters = []; for (const routeId of store.selectedRouteIds) { @@ -102,3 +139,15 @@ const shownLines = computed(() => { return l; }); + + + + diff --git a/app/components/sidebar/lines.vue b/app/components/sidebar/lines.vue index db19cbe..9f6f807 100644 --- a/app/components/sidebar/lines.vue +++ b/app/components/sidebar/lines.vue @@ -1,5 +1,5 @@