diff client/src/components/map/Map.vue @ 4207:9264d6405b4d stylesconfig

styles-config: revert from changeset 4288:cd267ed8371e
author Fadi Abbud <fadi.abbud@intevation.de>
date Wed, 14 Aug 2019 17:35:52 +0200
parents cd267ed8371e
children 8962a25d4290
line wrap: on
line diff
--- a/client/src/components/map/Map.vue	Wed Aug 14 17:30:49 2019 +0200
+++ b/client/src/components/map/Map.vue	Wed Aug 14 17:35:52 2019 +0200
@@ -271,25 +271,32 @@
           );
         }
         // load configured bottleneck colors
-        HTTP.get("/system/settings", {
+        HTTP.get("/system/style/Bottlenecks/stroke", {
           headers: { "X-Gemma-Auth": localStorage.getItem("token") }
         })
           .then(response => {
-            let btlnStrokeC = response.data.bottlenecks_stroke;
-            let btlnFillC = response.data.bottlenecks_fill;
-            console.log("aa");
-            var newStyle = new Style({
-              stroke: new Stroke({
-                color: btlnStrokeC,
-                width: 4
-              }),
-              fill: new Fill({
-                color: btlnFillC
+            let btlnStrokeC = response.data.code;
+            HTTP.get("/system/style/Bottlenecks/fill", {
+              headers: { "X-Gemma-Auth": localStorage.getItem("token") }
+            })
+              .then(response => {
+                let btlnFillC = response.data.code;
+                var newStyle = new Style({
+                  stroke: new Stroke({
+                    color: btlnStrokeC,
+                    width: 4
+                  }),
+                  fill: new Fill({
+                    color: btlnFillC
+                  })
+                });
+                this.layers.get("BOTTLENECKS").setStyle(newStyle);
+                this.$store.commit("gauges/deleteNashSutcliffeCache");
+                this.$store.dispatch("map/refreshLayers");
               })
-            });
-            this.layers.get("BOTTLENECKS").setStyle(newStyle);
-            this.$store.commit("gauges/deleteNashSutcliffeCache");
-            this.$store.dispatch("map/refreshLayers");
+              .catch(error => {
+                console.log(error);
+              });
           })
           .catch(error => {
             console.log(error);