mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: [vue][add-address] fix map center when editing existing address
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/674
This commit is contained in:
parent
49380f5f61
commit
52512e45fc
@ -19,7 +19,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
center() {
|
||||
return this.entity.selected.addressMap.center;
|
||||
return this.entity.addressMap.center;
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
@ -41,10 +41,10 @@ export default {
|
||||
this.marker.addTo(this.map);
|
||||
},
|
||||
update() {
|
||||
//console.log('update map with : ', this.entity.addressMap.center)
|
||||
if (this.marker && this.entity.addressMap.center) {
|
||||
this.marker.setLatLng(this.entity.addressMap.center);
|
||||
this.map.setView(this.entity.addressMap.center, 15);
|
||||
console.log('update map with : ', this.center)
|
||||
if (this.marker && this.center) {
|
||||
this.marker.setLatLng(this.center);
|
||||
this.map.setView(this.center, 15);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -98,6 +98,11 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.value.point) {
|
||||
this.updateMapCenter(this.value.point);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
transName(value) {
|
||||
return value.streetNumber === undefined ? value.street : `${value.streetNumber}, ${value.street}`
|
||||
|
Loading…
x
Reference in New Issue
Block a user