# HG changeset patch # User Markus Kottlaender # Date 1552565803 -3600 # Node ID 50cfb12a54a4b453ebcd1891a5f97f2bfa46250e # Parent 27933e66e848aff248a6ae6c08eb58219a69f472 client: gauges: fixed bug with panning to gauge... ...when diagram is expanded after collapsing it and then chosing another gauge diff -r 27933e66e848 -r 50cfb12a54a4 client/src/components/gauge/Gauges.vue --- a/client/src/components/gauge/Gauges.vue Thu Mar 14 13:11:22 2019 +0100 +++ b/client/src/components/gauge/Gauges.vue Thu Mar 14 13:16:43 2019 +0100 @@ -125,6 +125,11 @@ }); }, showWaterlevelDiagram() { + // for panning the map to the gauge on opening the diagram: needs to be + // set outside of the expandCallback to not always refer to the currently + // selectedGauge + let coordinates = this.selectedGauge.geometry.coordinates; + // configure splitscreen let splitscreenConf = { id: "gauge-waterlevel", @@ -140,7 +145,7 @@ }, expandCallback: () => { this.$store.commit("map/moveMap", { - coordinates: this.selectedGauge.geometry.coordinates, + coordinates, zoom: 17, preventZoomOut: true });