comparison client/src/components/fairway/AvailableFairwayDepthDialogue.vue @ 3309:80037790032d

client: fully implemented sections - added map layer with new style - implemented in identify tool, map popup and fairway availability dialog - added sidebar menu item
author Markus Kottlaender <markus@intevation.de>
date Fri, 17 May 2019 12:45:13 +0200
parents fa7dc3f31ef3
children 70676557a66f
comparison
equal deleted inserted replaced
3308:1128b29aed8b 3309:80037790032d
251 if (this.type === this.$options.STRETCHES) { 251 if (this.type === this.$options.STRETCHES) {
252 this.openLayersMap() 252 this.openLayersMap()
253 .getLayer("STRETCHES") 253 .getLayer("STRETCHES")
254 .setVisible(true); 254 .setVisible(true);
255 } 255 }
256 if (this.type === this.$options.SECTIONS) {
257 this.openLayersMap()
258 .getLayer("SECTIONS")
259 .setVisible(true);
260 }
256 if (this.selectedFairwayAvailabilityFeature) { 261 if (this.selectedFairwayAvailabilityFeature) {
257 this.$store.dispatch("map/moveToFeauture", { 262 this.$store.dispatch("map/moveToFeauture", {
258 feature: this.selectedFairwayAvailabilityFeature, 263 feature: this.selectedFairwayAvailabilityFeature,
259 zoom: 17, 264 zoom: 17,
260 preventZoomOut: true 265 preventZoomOut: true
273 setSelectedStretch() { 278 setSelectedStretch() {
274 const stretch = this.stretches.find(x => x.id === this.selectedStretchId); 279 const stretch = this.stretches.find(x => x.id === this.selectedStretchId);
275 this.$store.commit( 280 this.$store.commit(
276 "fairwayavailability/setSelectedFairwayAvailability", 281 "fairwayavailability/setSelectedFairwayAvailability",
277 stretch 282 stretch
283 );
284 },
285 setSelectedSection() {
286 const section = this.sections.find(x => x.id === this.selectedSectionId);
287 this.$store.commit(
288 "fairwayavailability/setSelectedFairwayAvailability",
289 section
278 ); 290 );
279 } 291 }
280 }, 292 },
281 computed: { 293 computed: {
282 ...mapState("application", [ 294 ...mapState("application", [
289 "from", 301 "from",
290 "to", 302 "to",
291 "frequency", 303 "frequency",
292 "LOS" 304 "LOS"
293 ]), 305 ]),
294 ...mapState("imports", ["stretches", "selectedStretchId"]), 306 ...mapState("imports", [
307 "stretches",
308 "sections",
309 "selectedStretchId",
310 "selectedSectionId"
311 ]),
295 ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]), 312 ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]),
296 ...mapGetters("map", ["openLayersMap"]), 313 ...mapGetters("map", ["openLayersMap"]),
297 ...mapGetters("bottlenecks", ["orderedBottlenecks"]), 314 ...mapGetters("bottlenecks", ["orderedBottlenecks"]),
298 isComplete() { 315 isComplete() {
299 return ( 316 return (
356 } 373 }
357 }, 374 },
358 entries() { 375 entries() {
359 if (this.type === this.$options.BOTTLENECKS) return this.bottlenecksList; 376 if (this.type === this.$options.BOTTLENECKS) return this.bottlenecksList;
360 if (this.type === this.$options.STRETCHES) return this.stretches; 377 if (this.type === this.$options.STRETCHES) return this.stretches;
378 if (this.type === this.$options.SECTIONS) return this.sections;
361 return []; 379 return [];
362 }, 380 },
363 label() { 381 label() {
364 return this.$gettext("Available fairway depth"); 382 return this.$gettext("Available fairway depth");
365 }, 383 },
381 this.setSelectedBottleneck(); 399 this.setSelectedBottleneck();
382 } else if ( 400 } else if (
383 this.type === this.$options.STRETCHES && 401 this.type === this.$options.STRETCHES &&
384 this.selectedStretchId 402 this.selectedStretchId
385 ) { 403 ) {
404 this.openLayersMap()
405 .getLayer("STRETCHES")
406 .setVisible(true);
386 this.setSelectedStretch(); 407 this.setSelectedStretch();
408 } else if (
409 this.type === this.$options.SECTIONS &&
410 this.selectedSectionId
411 ) {
412 this.openLayersMap()
413 .getLayer("SECTIONS")
414 .setVisible(true);
415 this.setSelectedSection();
387 } else { 416 } else {
388 this.$store.commit( 417 this.$store.commit(
389 "fairwayavailability/setSelectedFairwayAvailability", 418 "fairwayavailability/setSelectedFairwayAvailability",
390 null 419 null
391 ); 420 );
392 } 421 }
393 this.openLayersMap()
394 .getLayer("STRETCHES")
395 .setVisible(true);
396 }, 422 },
397 showFairwayDepth() { 423 showFairwayDepth() {
398 if (this.showFairwayDepth) { 424 if (this.showFairwayDepth) {
399 this.loading = true; 425 this.loading = true;
400 this.$store.dispatch("bottlenecks/loadBottlenecksList").then(() => { 426 Promise.all([
401 this.$store.dispatch("imports/loadStretches").then(() => { 427 this.$store.dispatch("bottlenecks/loadBottlenecksList"),
402 this.loading = false; 428 this.$store.dispatch("imports/loadStretches"),
429 this.$store.dispatch("imports/loadSections")
430 ])
431 .then(() => {
403 if (this.selectedBottleneck) this.setSelectedBottleneck(); 432 if (this.selectedBottleneck) this.setSelectedBottleneck();
404 }); 433 })
405 }); 434 .finally(() => (this.loading = false));
406 } 435 }
407 } 436 }
408 }, 437 },
409 BOTTLENECKS: "bottlenecks", 438 BOTTLENECKS: "bottlenecks",
410 SECTIONS: "sections", 439 SECTIONS: "sections",