minor with maps
This commit is contained in:
parent
e95076ee3f
commit
152e8f5bc6
3 changed files with 12 additions and 10 deletions
|
@ -3,7 +3,7 @@ client-only(placeholder='Loading...' )
|
||||||
v-card
|
v-card
|
||||||
v-container
|
v-container
|
||||||
LMap(ref="map"
|
LMap(ref="map"
|
||||||
id="leaflet-map"
|
id="leaflet-map-dialog"
|
||||||
:zoom="zoom"
|
:zoom="zoom"
|
||||||
:options="{attributionControl: false}"
|
:options="{attributionControl: false}"
|
||||||
:center="center")
|
:center="center")
|
||||||
|
@ -105,7 +105,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#leaflet-map {
|
#leaflet-map-dialog {
|
||||||
height: 55vh;
|
height: 55vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: .3rem;
|
border-radius: .3rem;
|
||||||
|
|
|
@ -17,7 +17,6 @@ client-only(placeholder='Loading...' )
|
||||||
|
|
||||||
import "leaflet/dist/leaflet.css"
|
import "leaflet/dist/leaflet.css"
|
||||||
import { LMap, LTileLayer, LMarker, LPopup, LControlAttribution } from 'vue2-leaflet'
|
import { LMap, LTileLayer, LMarker, LPopup, LControlAttribution } from 'vue2-leaflet'
|
||||||
import { mapActions, mapState } from 'vuex'
|
|
||||||
import { Icon } from 'leaflet'
|
import { Icon } from 'leaflet'
|
||||||
import { mdiWalk, mdiBike, mdiCar, mdiMapMarker } from '@mdi/js'
|
import { mdiWalk, mdiBike, mdiCar, mdiMapMarker } from '@mdi/js'
|
||||||
|
|
||||||
|
@ -35,15 +34,21 @@ export default {
|
||||||
url: $store.state.settings.tilelayer_provider || 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
url: $store.state.settings.tilelayer_provider || 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
attribution: $store.state.settings.tilelayer_provider_attribution || "<a target=\"_blank\" href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",
|
attribution: $store.state.settings.tilelayer_provider_attribution || "<a target=\"_blank\" href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",
|
||||||
zoom: 16,
|
zoom: 16,
|
||||||
center: [this.place.latitude, this.place.longitude],
|
}
|
||||||
marker: {
|
},
|
||||||
|
computed: {
|
||||||
|
center () {
|
||||||
|
return [this.place.latitude, this.place.longitude]
|
||||||
|
},
|
||||||
|
marker () {
|
||||||
|
return {
|
||||||
address: this.place.address,
|
address: this.place.address,
|
||||||
coordinates: {lat: this.place.latitude, lon: this.place.longitude }
|
coordinates: {lat: this.place.latitude, lon: this.place.longitude }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
place: { type: Object, default: () => ({}) }
|
place: { type: Object, default: () => ({ latitude: 0, longitude: 0 }) }
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
delete Icon.Default.prototype._getIconUrl;
|
delete Icon.Default.prototype._getIconUrl;
|
||||||
|
|
|
@ -15,7 +15,6 @@ v-card
|
||||||
@change='selectAddress'
|
@change='selectAddress'
|
||||||
@focus='searchAddress'
|
@focus='searchAddress'
|
||||||
:items="addressList"
|
:items="addressList"
|
||||||
:disabled='disableGeocoded'
|
|
||||||
:hint="$t('event.address_description_osm')")
|
:hint="$t('event.address_description_osm')")
|
||||||
template(v-slot:message="{message, key}")
|
template(v-slot:message="{message, key}")
|
||||||
span(v-html='message' :key="key")
|
span(v-html='message' :key="key")
|
||||||
|
@ -30,13 +29,11 @@ v-card
|
||||||
v-col.py-0(cols=12 sm=6)
|
v-col.py-0(cols=12 sm=6)
|
||||||
v-text-field(v-model="place.latitude"
|
v-text-field(v-model="place.latitude"
|
||||||
:prepend-icon='mdiLatitude'
|
:prepend-icon='mdiLatitude'
|
||||||
:disabled='disableGeocoded'
|
|
||||||
:label="$t('common.latitude')"
|
:label="$t('common.latitude')"
|
||||||
:rules="$validators.latitude")
|
:rules="$validators.latitude")
|
||||||
v-col.py-0(cols=12 sm=6)
|
v-col.py-0(cols=12 sm=6)
|
||||||
v-text-field(v-model="place.longitude"
|
v-text-field(v-model="place.longitude"
|
||||||
:prepend-icon='mdiLongitude'
|
:prepend-icon='mdiLongitude'
|
||||||
:disabled='disableGeocoded'
|
|
||||||
:label="$t('common.longitude')"
|
:label="$t('common.longitude')"
|
||||||
:rules="$validators.longitude")
|
:rules="$validators.longitude")
|
||||||
p.mt-4(v-if='place.isNew' v-html="$t('event.address_geocoded_disclaimer')")
|
p.mt-4(v-if='place.isNew' v-html="$t('event.address_geocoded_disclaimer')")
|
||||||
|
|
Loading…
Reference in a new issue