minor with maps

This commit is contained in:
lesion 2023-04-09 21:43:51 +02:00
parent e95076ee3f
commit 152e8f5bc6
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 12 additions and 10 deletions

View file

@ -3,7 +3,7 @@ client-only(placeholder='Loading...' )
v-card
v-container
LMap(ref="map"
id="leaflet-map"
id="leaflet-map-dialog"
:zoom="zoom"
:options="{attributionControl: false}"
:center="center")
@ -105,7 +105,7 @@ export default {
</script>
<style>
#leaflet-map {
#leaflet-map-dialog {
height: 55vh;
width: 100%;
border-radius: .3rem;

View file

@ -17,7 +17,6 @@ client-only(placeholder='Loading...' )
import "leaflet/dist/leaflet.css"
import { LMap, LTileLayer, LMarker, LPopup, LControlAttribution } from 'vue2-leaflet'
import { mapActions, mapState } from 'vuex'
import { Icon } from 'leaflet'
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',
attribution: $store.state.settings.tilelayer_provider_attribution || "<a target=\"_blank\" href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",
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,
coordinates: {lat: this.place.latitude, lon: this.place.longitude }
}
}
},
props: {
place: { type: Object, default: () => ({}) }
place: { type: Object, default: () => ({ latitude: 0, longitude: 0 }) }
},
mounted() {
delete Icon.Default.prototype._getIconUrl;

View file

@ -15,7 +15,6 @@ v-card
@change='selectAddress'
@focus='searchAddress'
:items="addressList"
:disabled='disableGeocoded'
:hint="$t('event.address_description_osm')")
template(v-slot:message="{message, key}")
span(v-html='message' :key="key")
@ -30,13 +29,11 @@ v-card
v-col.py-0(cols=12 sm=6)
v-text-field(v-model="place.latitude"
:prepend-icon='mdiLatitude'
:disabled='disableGeocoded'
:label="$t('common.latitude')"
:rules="$validators.latitude")
v-col.py-0(cols=12 sm=6)
v-text-field(v-model="place.longitude"
:prepend-icon='mdiLongitude'
:disabled='disableGeocoded'
:label="$t('common.longitude')"
:rules="$validators.longitude")
p.mt-4(v-if='place.isNew' v-html="$t('event.address_geocoded_disclaimer')")