comparison client/src/components/fairway/Profiles.vue @ 3044:c71373594719

client: map: prepared store to hold multiple map objects This will be necessary to sync maps, toggle layers per map, etc. Therefore the methods to move the map (moveToExtent, etc.) became actions instead of mutations.
author Markus Kottlaender <markus@intevation.de>
date Sat, 13 Apr 2019 16:02:06 +0200
parents 44493664d40e
children 1ef2f4179d30
comparison
equal deleted inserted replaced
3043:de75404cb5fc 3044:c71373594719
245 * Software engineering by Intevation GmbH 245 * Software engineering by Intevation GmbH
246 * 246 *
247 * Author(s): 247 * Author(s):
248 * Markus Kottländer <markus.kottlaender@intevation.de> 248 * Markus Kottländer <markus.kottlaender@intevation.de>
249 */ 249 */
250 import { mapState } from "vuex"; 250 import { mapState, mapGetters } from "vuex";
251 import Feature from "ol/Feature"; 251 import Feature from "ol/Feature";
252 import LineString from "ol/geom/LineString"; 252 import LineString from "ol/geom/LineString";
253 import { displayError, displayInfo } from "@/lib/errors"; 253 import { displayError, displayInfo } from "@/lib/errors";
254 import { HTTP } from "@/lib/http"; 254 import { HTTP } from "@/lib/http";
255 255
262 showLabelInput: false 262 showLabelInput: false
263 }; 263 };
264 }, 264 },
265 computed: { 265 computed: {
266 ...mapState("application", ["showProfiles"]), 266 ...mapState("application", ["showProfiles"]),
267 ...mapState("map", ["openLayersMap", "lineTool", "polygonTool", "cutTool"]), 267 ...mapState("map", ["lineTool", "polygonTool", "cutTool"]),
268 ...mapState("bottlenecks", [ 268 ...mapState("bottlenecks", [
269 "bottlenecksList", 269 "bottlenecksList",
270 "surveys", 270 "surveys",
271 "surveysLoading" 271 "surveysLoading"
272 ]), 272 ]),
276 "endPoint", 276 "endPoint",
277 "profileLoading", 277 "profileLoading",
278 "differencesLoading", 278 "differencesLoading",
279 "waterLevels" 279 "waterLevels"
280 ]), 280 ]),
281 ...mapGetters("map", ["openLayersMap"]),
281 orderedBottlenecks() { 282 orderedBottlenecks() {
282 let groupedBottlenecks = {}, 283 let groupedBottlenecks = {},
283 orderedGroups = {}; 284 orderedGroups = {};
284 285
285 // group bottlenecks by cc 286 // group bottlenecks by cc
567 moveToBottleneck() { 568 moveToBottleneck() {
568 const bottleneck = this.bottlenecksList.find( 569 const bottleneck = this.bottlenecksList.find(
569 bn => bn.properties.name === this.selectedBottleneck 570 bn => bn.properties.name === this.selectedBottleneck
570 ); 571 );
571 if (!bottleneck) return; 572 if (!bottleneck) return;
572 this.$store.commit("map/moveToExtent", { 573 this.$store.dispatch("map/moveToExtent", {
573 feature: bottleneck, 574 feature: bottleneck,
574 zoom: 17, 575 zoom: 17,
575 preventZoomOut: true 576 preventZoomOut: true
576 }); 577 });
577 } 578 }