Zoom to map marker in when clicking on geometry value

This commit is contained in:
Jože Fortun
2023-04-07 16:53:18 +02:00
parent f43d2b5ba4
commit 553ad7cf0b
2 changed files with 5 additions and 5 deletions
@@ -296,7 +296,7 @@ export default {
this.localValueIndex = index
const firstCoordinates = (index ? this.localValue[index] : (this.field.isMulti ? this.localValue[0] : this.localValue)) || {}
this.map.center = firstCoordinates.coordinates && firstCoordinates.coordinates.length ? firstCoordinates.coordinates : this.field.options.center
this.map.zoom = this.field.options.zoom
this.map.zoom = index >= 0 ? 13 : this.field.options.zoom
this.map.show = true
setTimeout(() => {
@@ -138,10 +138,10 @@ export default {
},
methods: {
openMap (i) {
this.localValueIndex = i
this.map.center = this.localValue[i] || this.field.options.center
this.map.zoom = this.localValue[i] ? this.map.zoom : this.field.options.zoom
openMap (index) {
this.localValueIndex = index
this.map.center = this.localValue[index] || this.field.options.center
this.map.zoom = index >= 0 ? 13 : this.field.options.zoom
this.map.show = true
setTimeout(() => {