mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
address: zoom to postal code
This commit is contained in:
parent
78f66d4f14
commit
cae3defedb
@ -50,7 +50,7 @@ import VueMultiselect from 'vue-multiselect';
|
|||||||
export default {
|
export default {
|
||||||
name: 'CitySelection',
|
name: 'CitySelection',
|
||||||
components: { VueMultiselect },
|
components: { VueMultiselect },
|
||||||
props: ['entity', 'focusOnAddress'],
|
props: ['entity', 'focusOnAddress', 'updateMapCenter'],
|
||||||
emits: ['getReferenceAddresses'],
|
emits: ['getReferenceAddresses'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -95,6 +95,7 @@ export default {
|
|||||||
return (value.code && value.name) ? `${value.code}-${value.name}` : '';
|
return (value.code && value.name) ? `${value.code}-${value.name}` : '';
|
||||||
},
|
},
|
||||||
selectCity(value) {
|
selectCity(value) {
|
||||||
|
console.log(value)
|
||||||
this.entity.selected.city = value;
|
this.entity.selected.city = value;
|
||||||
this.entity.selected.postcode.name = value.name;
|
this.entity.selected.postcode.name = value.name;
|
||||||
this.entity.selected.postcode.code = value.code;
|
this.entity.selected.postcode.code = value.code;
|
||||||
@ -102,6 +103,7 @@ export default {
|
|||||||
console.log('writeNew.postcode false, in selectCity');
|
console.log('writeNew.postcode false, in selectCity');
|
||||||
this.$emit('getReferenceAddresses', value);
|
this.$emit('getReferenceAddresses', value);
|
||||||
this.focusOnAddress();
|
this.focusOnAddress();
|
||||||
|
this.updateMapCenter(value.center);
|
||||||
},
|
},
|
||||||
listenInputSearch(query) {
|
listenInputSearch(query) {
|
||||||
//console.log('listenInputSearch', query, this.isCitySelectorOpen);
|
//console.log('listenInputSearch', query, this.isCitySelectorOpen);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
<city-selection
|
<city-selection
|
||||||
v-bind:entity="entity"
|
v-bind:entity="entity"
|
||||||
v-bind:focusOnAddress="focusOnAddress"
|
v-bind:focusOnAddress="focusOnAddress"
|
||||||
|
v-bind:updateMapCenter="updateMapCenter"
|
||||||
@getReferenceAddresses="$emit('getReferenceAddresses', selected.city)">
|
@getReferenceAddresses="$emit('getReferenceAddresses', selected.city)">
|
||||||
</city-selection>
|
</city-selection>
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateMapCenter(point) {
|
updateMapCenter(point) {
|
||||||
//console.log('point', point);
|
console.log('point', point);
|
||||||
this.addressMap.center[0] = point.coordinates[1]; // TODO use reverse()
|
this.addressMap.center[0] = point.coordinates[1]; // TODO use reverse()
|
||||||
this.addressMap.center[1] = point.coordinates[0];
|
this.addressMap.center[1] = point.coordinates[0];
|
||||||
this.$refs.addressMap.update(); // cast child methods
|
this.$refs.addressMap.update(); // cast child methods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user