From 553ad7cf0b54ee795a87788bb70999427a251b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 7 Apr 2023 16:40:01 +0200 Subject: [PATCH] Zoom to map marker in when clicking on geometry value --- .../src/components/ModuleFields/Editor/Geometry.vue | 2 +- .../src/components/ModuleFields/Viewer/Geometry.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue b/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue index 41c8e96e9..89d1a2190 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/Geometry.vue @@ -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(() => { diff --git a/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue b/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue index dd7d9fb25..237b71e8f 100644 --- a/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue +++ b/client/web/compose/src/components/ModuleFields/Viewer/Geometry.vue @@ -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(() => {