From 4584924175ccc743ca0edc8cf4a8b676c983b642 Mon Sep 17 00:00:00 2001 From: sedum Date: Tue, 2 May 2023 19:30:31 +0200 Subject: [PATCH] add map marker draggable --- components/Map.vue | 13 ++++++++++++- components/WhereInputAdvanced.vue | 3 ++- components/admin/Places.vue | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/components/Map.vue b/components/Map.vue index be67663a..02d0b42e 100644 --- a/components/Map.vue +++ b/components/Map.vue @@ -13,7 +13,9 @@ client-only(placeholder='Loading...' ) :url="url" :attribution="attribution") LMarker(v-if="showMarker" - :lat-lng="marker.coordinates") + :lat-lng="marker.coordinates" + @update:lat-lng="updateCoords" + :draggable="draggable") diff --git a/components/WhereInputAdvanced.vue b/components/WhereInputAdvanced.vue index d81faa11..d2074761 100644 --- a/components/WhereInputAdvanced.vue +++ b/components/WhereInputAdvanced.vue @@ -38,7 +38,8 @@ v-card :rules="$validators.longitude") p.mt-4(v-if='place.isNew' v-html="$t('event.address_geocoded_disclaimer')") - Map.mt-4(:place='place' v-if="(settings.allow_geolocation && place.name !== 'online' && place.latitude && place.longitude)" ) + Map.mt-4(:place='place' draggable=true + v-if="(settings.allow_geolocation && place.name !== 'online' && place.latitude && place.longitude)" ) v-divider(v-if='settings.allow_online_event && showGeocoded') diff --git a/components/admin/Places.vue b/components/admin/Places.vue index ee80662f..7ec8e189 100644 --- a/components/admin/Places.vue +++ b/components/admin/Places.vue @@ -62,7 +62,8 @@ v-container :label="$t('common.longitude')" :rules="$validators.longitude") - Map.mt-4(:place.sync='place' :key="dialog" v-if="settings.allow_geolocation && place.name !== 'online' && place.latitude && place.longitude") + Map.mt-4(:place.sync='place' :key="dialog" draggable=true + v-if="settings.allow_geolocation && place.name !== 'online' && place.latitude && place.longitude") v-card-actions v-spacer @@ -109,7 +110,7 @@ export default { addressList: [], address: '', search: '', - place: { name: '', address: '', id: null }, + place: { name: '', address: '', latitude: 0, longitude: 0, id: null }, headers: [ { value: 'name', text: this.$t('common.name') }, { value: 'address', text: this.$t('common.address') },