address: zoom on postal code on select city

This commit is contained in:
nobohan 2021-10-08 15:51:51 +02:00
parent c87eda32cb
commit acbd6e761a
2 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,7 @@ import VueMultiselect from 'vue-multiselect';
export default {
name: 'CitySelection',
components: { VueMultiselect },
props: ['entity', 'focusOnAddress'],
props: ['entity', 'focusOnAddress', 'updateMapCenter'],
emits: ['getReferenceAddresses'],
data() {
return {
@ -102,6 +102,9 @@ export default {
console.log('writeNew.postcode false, in selectCity');
this.$emit('getReferenceAddresses', value);
this.focusOnAddress();
if (value.center) {
this.updateMapCenter(value.center);
}
},
listenInputSearch(query) {
//console.log('listenInputSearch', query, this.isCitySelectorOpen);

View File

@ -31,6 +31,7 @@
<city-selection
v-bind:entity="entity"
v-bind:focusOnAddress="focusOnAddress"
v-bind:updateMapCenter="updateMapCenter"
@getReferenceAddresses="$emit('getReferenceAddresses', selected.city)">
</city-selection>