From 448d97e310c68bc353a7030dcacb974cae48e691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Thu, 18 Sep 2025 22:04:37 +0200 Subject: [PATCH] Fix map --- .../flightPlans/FlightPlanPlaceInput.vue | 19 +++-- .../flightPlans/FlightPlanRoute.vue | 3 + src/components/inputs/MapGPSInput.vue | 32 ++++--- src/components/map/MapWrapper.vue | 5 ++ src/components/poi/POIForm.vue | 23 ++--- src/composables/geocoding.js | 84 +++++++++++++------ src/graphql/fragments/flight.js | 2 +- 7 files changed, 112 insertions(+), 56 deletions(-) diff --git a/src/components/flightPlans/FlightPlanPlaceInput.vue b/src/components/flightPlans/FlightPlanPlaceInput.vue index 9f48805..2667ba2 100644 --- a/src/components/flightPlans/FlightPlanPlaceInput.vue +++ b/src/components/flightPlans/FlightPlanPlaceInput.vue @@ -29,13 +29,18 @@ const placesFilter = (val, update, abort) => { searchGeocode(val).then(results => { if (!results) return; - placesOptions.value = results.map(result => ({ - name: result.formatted_address, - type: "geocode", - id: null, - gpsLatitude: result.geometry.location.lat, - gpsLongitude: result.geometry.location.lng, - })) + console.log(results) + + placesOptions.value = results.map(result => { + console.log(result, result.geometry.location) + return { + name: result.formatted_address, + type: "geocode", + id: null, + gpsLatitude: result.geometry.location.lat(), + gpsLongitude: result.geometry.location.lng(), + } + }) }); } } else { diff --git a/src/components/flightPlans/FlightPlanRoute.vue b/src/components/flightPlans/FlightPlanRoute.vue index 8e7ba25..c6b055d 100644 --- a/src/components/flightPlans/FlightPlanRoute.vue +++ b/src/components/flightPlans/FlightPlanRoute.vue @@ -31,6 +31,9 @@ const swapMarkers = (idx1, idx2) => { }; const handlePlaceSelect = (modelVal) => { model.value.push(modelVal); + + // TODO: upravit bounds u mapy + } watch(() => model.value, () => { diff --git a/src/components/inputs/MapGPSInput.vue b/src/components/inputs/MapGPSInput.vue index 9d871b1..9c35471 100644 --- a/src/components/inputs/MapGPSInput.vue +++ b/src/components/inputs/MapGPSInput.vue @@ -1,6 +1,6 @@