diff client/src/store/bottlenecks.js @ 2957:b74ebeb2bdc8

client: layers: improved structure of layer configuration The object is now less cluttered, access to the layers is more direct, no need for helper methods anymore.
author Markus Kottlaender <markus@intevation.de>
date Mon, 08 Apr 2019 15:32:53 +0200
parents 1686ec185155
children 1b8bb4f89227
line wrap: on
line diff
--- a/client/src/store/bottlenecks.js	Mon Apr 08 14:53:09 2019 +0200
+++ b/client/src/store/bottlenecks.js	Mon Apr 08 15:32:53 2019 +0200
@@ -15,7 +15,6 @@
 import { HTTP } from "@/lib/http";
 import { WFS } from "ol/format.js";
 import { displayError } from "@/lib/errors.js";
-import { LAYERS } from "@/store/map.js";
 
 // initial state
 const init = () => {
@@ -61,7 +60,7 @@
     }
   },
   actions: {
-    setSelectedBottleneck({ state, commit, rootState, rootGetters }, name) {
+    setSelectedBottleneck({ state, commit, rootState }, name) {
       return new Promise((resolve, reject) => {
         if (name !== state.selectedBottleneck) {
           commit("selectedSurvey", null);
@@ -75,7 +74,7 @@
             commit("application/splitscreenLoading", false, { root: true });
           }, 350);
           rootState.map.cutTool.setActive(false);
-          rootGetters["map/getVSourceByName"](LAYERS.CUTTOOL).clear();
+          rootState.map.layers.CUTTOOL.getSource().clear();
         }
         if (name) {
           commit("application/showProfiles", true, { root: true });