comparison client/src/components/gauge/Gauges.vue @ 2644:50cfb12a54a4

client: gauges: fixed bug with panning to gauge... ...when diagram is expanded after collapsing it and then chosing another gauge
author Markus Kottlaender <markus@intevation.de>
date Thu, 14 Mar 2019 13:16:43 +0100
parents 27933e66e848
children cc3eee8b5d71
comparison
equal deleted inserted replaced
2643:27933e66e848 2644:50cfb12a54a4
123 zoom: 17, 123 zoom: 17,
124 preventZoomOut: true 124 preventZoomOut: true
125 }); 125 });
126 }, 126 },
127 showWaterlevelDiagram() { 127 showWaterlevelDiagram() {
128 // for panning the map to the gauge on opening the diagram: needs to be
129 // set outside of the expandCallback to not always refer to the currently
130 // selectedGauge
131 let coordinates = this.selectedGauge.geometry.coordinates;
132
128 // configure splitscreen 133 // configure splitscreen
129 let splitscreenConf = { 134 let splitscreenConf = {
130 id: "gauge-waterlevel", 135 id: "gauge-waterlevel",
131 component: "waterlevel", 136 component: "waterlevel",
132 title: 137 title:
138 this.$store.commit("gauges/selectedGaugeISRS", null); 143 this.$store.commit("gauges/selectedGaugeISRS", null);
139 this.$store.commit("gauges/waterlevels", []); 144 this.$store.commit("gauges/waterlevels", []);
140 }, 145 },
141 expandCallback: () => { 146 expandCallback: () => {
142 this.$store.commit("map/moveMap", { 147 this.$store.commit("map/moveMap", {
143 coordinates: this.selectedGauge.geometry.coordinates, 148 coordinates,
144 zoom: 17, 149 zoom: 17,
145 preventZoomOut: true 150 preventZoomOut: true
146 }); 151 });
147 } 152 }
148 }; 153 };