comparison client/src/components/Maplayer.vue @ 2989:87d34efafb3a

client: added uuid mixin to display multiple instances of the same component in splitview
author Markus Kottlaender <markus@intevation.de>
date Wed, 10 Apr 2019 11:03:15 +0200
parents 1b8bb4f89227
children 44493664d40e
comparison
equal deleted inserted replaced
2988:e1ccc8438529 2989:87d34efafb3a
38 * * Thomas Junk <thomas.junk@intevation.de> 38 * * Thomas Junk <thomas.junk@intevation.de>
39 * * Bernhard E. Reiter <bernhard.reiter@intevation.de> 39 * * Bernhard E. Reiter <bernhard.reiter@intevation.de>
40 */ 40 */
41 import { HTTP } from "@/lib/http"; 41 import { HTTP } from "@/lib/http";
42 import { mapState } from "vuex"; 42 import { mapState } from "vuex";
43 import uuid from "uuid";
44 import { Map, View } from "ol"; 43 import { Map, View } from "ol";
45 import { WFS, GeoJSON } from "ol/format"; 44 import { WFS, GeoJSON } from "ol/format";
46 import { equalTo } from "ol/format/filter"; 45 import { equalTo } from "ol/format/filter";
47 import { Stroke, Style, Fill } from "ol/style"; 46 import { Stroke, Style, Fill } from "ol/style";
48 import { displayError } from "@/lib/errors"; 47 import { displayError } from "@/lib/errors";
48 import { uuid } from "@/lib/mixins";
49 import "ol/ol.css"; 49 import "ol/ol.css";
50 50
51 /* for the sake of debugging */ 51 /* for the sake of debugging */
52 /* eslint-disable no-console */ 52 /* eslint-disable no-console */
53 export default { 53 export default {
54 mixins: [uuid],
54 data() { 55 data() {
55 return { 56 return {
56 splitscreen: false 57 splitscreen: false
57 }; 58 };
58 }, 59 },
67 "cutTool" 68 "cutTool"
68 ]), 69 ]),
69 ...mapState("bottlenecks", ["selectedSurvey"]), 70 ...mapState("bottlenecks", ["selectedSurvey"]),
70 ...mapState("application", ["showSplitscreen"]), 71 ...mapState("application", ["showSplitscreen"]),
71 ...mapState("imports", ["selectedStretchId"]), 72 ...mapState("imports", ["selectedStretchId"]),
72 uuid() {
73 return uuid.v4();
74 },
75 hasActiveInteractions() { 73 hasActiveInteractions() {
76 return ( 74 return (
77 (this.lineTool && this.lineTool.getActive()) || 75 (this.lineTool && this.lineTool.getActive()) ||
78 (this.polygonTool && this.polygonTool.getActive()) || 76 (this.polygonTool && this.polygonTool.getActive()) ||
79 (this.cutTool && this.cutTool.getActive()) 77 (this.cutTool && this.cutTool.getActive())