comparison client/src/components/gauge/Gauges.vue @ 3157:18a639e1f7f4

client: gauges: fixed zooming when selecting a gauge from the dialog The map was moved in two different places (watcher and change event) at the same time, making the zoom not work properly.
author Markus Kottlaender <markus@intevation.de>
date Mon, 06 May 2019 12:09:09 +0200
parents 47453337c698
children f7d7fdc58cad
comparison
equal deleted inserted replaced
3156:cb3b31566e48 3157:18a639e1f7f4
12 :closeCallback="close" 12 :closeCallback="close"
13 /> 13 />
14 <div class="box-body"> 14 <div class="box-body">
15 <UISpinnerOverlay v-if="loading" /> 15 <UISpinnerOverlay v-if="loading" />
16 <select 16 <select
17 @change="moveToGauge"
18 v-model="selectedGaugeISRS" 17 v-model="selectedGaugeISRS"
19 class="form-control font-weight-bold" 18 class="form-control font-weight-bold"
20 > 19 >
21 <option :value="null"> 20 <option :value="null">
22 <translate>Select Gauge</translate> 21 <translate>Select Gauge</translate>
180 }, 179 },
181 methods: { 180 methods: {
182 close() { 181 close() {
183 this.$store.commit("application/showGauges", false); 182 this.$store.commit("application/showGauges", false);
184 }, 183 },
185 moveToGauge() {
186 if (!this.selectedGauge) return;
187 this.$store.dispatch("map/moveToFeauture", {
188 feature: this.selectedGauge,
189 zoom: null,
190 preventZoomOut: true
191 });
192 },
193 showWaterlevelDiagram() { 184 showWaterlevelDiagram() {
194 this.loading = true; 185 this.loading = true;
195 Promise.all([ 186 Promise.all([
196 this.$store.dispatch("gauges/loadWaterlevels"), 187 this.$store.dispatch("gauges/loadWaterlevels"),
197 this.$store.dispatch("gauges/loadNashSutcliffe") 188 this.$store.dispatch("gauges/loadNashSutcliffe")