diff --git a/components/EventMapDialog.vue b/components/EventMapDialog.vue
new file mode 100644
index 00000000..378f2719
--- /dev/null
+++ b/components/EventMapDialog.vue
@@ -0,0 +1,65 @@
+
+v-card
+ v-container
+ div(:style="{'height': mapHeight}")
+ Map.mt-4(:place='event.place' :height='mapHeight' )
+
+ v-row.my-4.d-flex.flex-column.align-center.text-center
+ .text-h6
+ v-icon(v-text='mdiMapMarker' )
+ nuxt-link.ml-2.text-decoration-none(v-text="event.place.name" :to='`/place/${event.place.name}`')
+ .mx-2(v-text="`${event.place.address}`")
+ v-card-actions
+ v-row(color='primary')
+ //- p.my-4(v-text="$t('common.getting_there')")
+ v-btn.ml-2(icon large :href="routeBy('foot')")
+ v-icon(v-text='mdiWalk')
+ v-btn.ml-2(icon large :href="routeBy('bike')")
+ v-icon(v-text='mdiBike')
+ v-btn.ml-2(icon large :href="routeBy('car')")
+ v-icon(v-text='mdiCar')
+ v-spacer
+ v-btn(@click='$emit("close")' outlined) Close
+
+
diff --git a/components/Map.vue b/components/Map.vue
index a62b2beb..02d0b42e 100644
--- a/components/Map.vue
+++ b/components/Map.vue
@@ -1,43 +1,28 @@
client-only(placeholder='Loading...' )
- v-card
- v-container
- LMap(ref="map"
- id="leaflet-map-dialog"
- :zoom="zoom"
- :options="{attributionControl: false}"
- :center="center")
- LControlAttribution(position='bottomright' prefix="")
- LTileLayer(
- :url="url"
- :attribution="attribution")
- LMarker(
- :lat-lng="marker.coordinates")
+ LMap(ref="leafletMap"
+ id="leaflet-map"
+ :style="{ 'height': height }"
+ :zoom="zoom"
+ :options="{attributionControl: false}"
+ :center="center")
+ LControlAttribution(position='bottomright' prefix="")
+ LTileLayer(
+ @tileload="$emit('tileload')"
+ @tileerror="$emit('tileerror')"
+ :url="url"
+ :attribution="attribution")
+ LMarker(v-if="showMarker"
+ :lat-lng="marker.coordinates"
+ @update:lat-lng="updateCoords"
+ :draggable="draggable")
- v-row.my-4.d-flex.flex-column.align-center.text-center
- .text-h6
- v-icon(v-text='mdiMapMarker' )
- nuxt-link.ml-2.text-decoration-none(v-text="event.place.name" :to='`/place/${event.place.name}`')
- .mx-2(v-text="`${event.place.address}`")
- v-card-actions
- v-row
- //- p.my-4(v-text="$t('common.getting_there')")
- v-btn.ml-2(icon large :href="routeBy('foot')")
- v-icon(v-text='mdiWalk')
- v-btn.ml-2(icon large :href="routeBy('bike')")
- v-icon(v-text='mdiBike')
- v-btn.ml-2(icon large :href="routeBy('car')")
- v-icon(v-text='mdiCar')
- v-spacer
- v-btn(@click='$emit("close")' outlined) Close
diff --git a/components/WhereInputAdvanced.vue b/components/WhereInputAdvanced.vue
index bcaf5bdd..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')")
- MapEdit.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')
@@ -76,7 +77,7 @@ export default {
onlineLocations: { type: Array, default: [] }
},
components: {
- [process.client && 'MapEdit']: () => import('@/components/MapEdit.vue')
+ [process.client && 'Map']: () => import('@/components/Map.vue')
},
data ({$store}) {
return {
diff --git a/components/admin/Geolocation.vue b/components/admin/Geolocation.vue
index f1b23061..e951acaa 100644
--- a/components/admin/Geolocation.vue
+++ b/components/admin/Geolocation.vue
@@ -6,7 +6,7 @@ v-card
v-form
v-row
- v-col(md=3)
+ v-col(cols=12 md=3)
v-autocomplete.mb-4(v-model='geocoding_provider_type'
@blur="save('geocoding_provider_type', geocoding_provider_type )"
:label="$t('admin.geocoding_provider_type')"
@@ -15,7 +15,7 @@ v-card
:items="geocoding_provider_type_items"
:placeholder="geocoding_provider_type_default")
- v-col(md=5)
+ v-col(cols=12 md=5)
v-text-field.mb-4(v-model='geocoding_provider'
@blur="save('geocoding_provider', geocoding_provider )"
:label="$t('admin.geocoding_provider')"
@@ -23,7 +23,7 @@ v-card
persistent-hint
:placeholder="geocoding_provider_default")
- v-col(md=4)
+ v-col(cols=12 md=4)
v-autocomplete.mb-6(v-model="geocoding_countrycodes" :disabled="!(geocoding_provider_type === null || geocoding_provider_type === 'Nominatim')"
:append-icon='mdiChevronDown'
@blur="save('geocoding_countrycodes', geocoding_countrycodes )"
@@ -35,7 +35,7 @@ v-card
:hint="$t('admin.geocoding_countrycodes_help')")
v-row
- v-col(md=6)
+ v-col(cols=12 md=6)
v-text-field.mb-4(v-model='tilelayer_provider'
@blur="save('tilelayer_provider', tilelayer_provider )"
:label="$t('admin.tilelayer_provider')"
@@ -43,39 +43,44 @@ v-card
persistent-hint
:placeholder="tilelayer_provider_default")
- v-col(md=6)
+ v-col(cols=12 md=6)
v-text-field(v-model='tilelayer_provider_attribution'
@blur="save('tilelayer_provider_attribution', tilelayer_provider_attribution )"
:label="$t('admin.tilelayer_provider_attribution')"
:placeholder="tilelayer_provider_attribution_default")
- div(id="leaflet-map-preview" max-height='10px')
- //- Map
+ Map(:key='mapKey' v-if='mapPreview'
+ @tileerror='tilelayerTestError'
+ @tileload='tilelayerTestSuccess'
+ height="20rem"
+ showMarker=false
+ :mapCenter='mapCenter'
+ :zoom='10')
v-card-actions
v-spacer
- v-btn(color='primary' @click='testGeocodingProvider' :loading='testGeocodingLoading' outlined ) {{$t('admin.geocoding_test_button')}}
- v-btn(color='primary' @click='testTileLayerProvider' :loading='testTileLayerLoading' outlined ) {{$t('admin.tilelayer_test_button')}}
+ v-btn(color='primary' @click='testGeocodingProvider' :loading='isNewGeocodingTest' outlined ) {{$t('admin.geocoding_test_button')}}
+ v-btn(color='primary' @click='testTileLayerProvider' :loading='isNewTilelayerTest' outlined ) {{$t('admin.tilelayer_test_button')}}
-
diff --git a/components/admin/Places.vue b/components/admin/Places.vue
index e1d7c11c..94172cd4 100644
--- a/components/admin/Places.vue
+++ b/components/admin/Places.vue
@@ -62,7 +62,8 @@ v-container
:label="$t('common.longitude')"
:rules="$validators.longitude")
- MapEdit.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
@@ -96,7 +97,7 @@ import geolocation from '../../server/helpers/geolocation/index'
export default {
components: {
- [process.client && 'MapEdit']: () => import('@/components/MapEdit.vue')
+ [process.client && 'Map']: () => import('@/components/Map.vue')
},
data( {$store} ) {
return {
@@ -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') },
@@ -128,7 +129,8 @@ export default {
},
async fetch() {
this.places = await this.$axios.$get('/places')
- this.places.splice(this.places.findIndex((p) => p.name === 'online' ), 1)
+ // do not allow edit the online place
+ this.places = this.places.filter(p => p.name !== 'online')
},
computed: {
...mapState(['settings']),
diff --git a/pages/event/_slug.vue b/pages/event/_slug.vue
index b719419b..3991c8ec 100644
--- a/pages/event/_slug.vue
+++ b/pages/event/_slug.vue
@@ -177,7 +177,7 @@ v-container#event.pa-2.pa-sm-2(itemscope itemtype="https://schema.org/Event" v-t
EmbedEvent(:event='event' @close='showEmbed=false')
v-dialog(v-show='settings.allow_geolocation && event.place.latitude && event.place.longitude' v-model='mapModal' :fullscreen='$vuetify.breakpoint.xsOnly' destroy-on-close)
- Map(:event='event' @close='mapModal=false')
+ EventMapDialog(:event='event' @close='mapModal=false')