Zoom to map marker in when clicking on geometry value
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user