Mercurial > gemma
comparison client/src/components/staging/StagingDetail.vue @ 2140:55bedb39295a
feat: clicking on stretches activates according layer
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 07 Feb 2019 10:30:44 +0100 |
parents | 3138d60dd1a6 |
children | ba43b29e8694 |
comparison
equal
deleted
inserted
replaced
2139:22bbd0d0500e | 2140:55bedb39295a |
---|---|
160 import { HTTP } from "@/lib/http"; | 160 import { HTTP } from "@/lib/http"; |
161 import { WFS } from "ol/format.js"; | 161 import { WFS } from "ol/format.js"; |
162 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter.js"; | 162 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter.js"; |
163 import { displayError } from "@/lib/errors.js"; | 163 import { displayError } from "@/lib/errors.js"; |
164 import { mapState } from "vuex"; | 164 import { mapState } from "vuex"; |
165 import { LAYERS } from "@/store/map.js"; | |
165 | 166 |
166 export default { | 167 export default { |
167 name: "stagingdetail", | 168 name: "stagingdetail", |
168 props: ["data"], | 169 props: ["data"], |
169 data() { | 170 data() { |
204 } | 205 } |
205 } | 206 } |
206 }, | 207 }, |
207 methods: { | 208 methods: { |
208 zoomToStretch(name) { | 209 zoomToStretch(name) { |
210 this.$store.commit("map/setLayerVisible", LAYERS.STRETCHES); | |
209 this.$store | 211 this.$store |
210 .dispatch("imports/loadStretch", name) | 212 .dispatch("imports/loadStretch", name) |
211 .then(response => { | 213 .then(response => { |
212 if (response.data.features.length < 1) | 214 if (response.data.features.length < 1) |
213 throw new Error("no feaures found for: " + name); | 215 throw new Error("no feaures found for: " + name); |
299 }, | 301 }, |
300 isApproved(item) { | 302 isApproved(item) { |
301 return item.status === STATES.APPROVED; | 303 return item.status === STATES.APPROVED; |
302 }, | 304 }, |
303 moveToBottleneck(index) { | 305 moveToBottleneck(index) { |
306 this.$store.commit("map/setLayerVisible", LAYERS.BOTTLENECKS); | |
304 this.moveToExtent(this.bottlenecks[index]); | 307 this.moveToExtent(this.bottlenecks[index]); |
305 }, | 308 }, |
306 moveToExtent(feature) { | 309 moveToExtent(feature) { |
307 this.$store.commit("map/moveToExtent", { | 310 this.$store.commit("map/moveToExtent", { |
308 feature: feature, | 311 feature: feature, |