diff client/src/components/systemconfiguration/MapLayers.vue @ 4022:efe0904b1d45

Change of ECDIS no longer requires reload When the maps are initialized, the source of th ECDIS is retireved from the store. When a change of the configuration is made, the store is updated.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 22 Jul 2019 13:28:04 +0200
parents 851c0ccba59b
children
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/MapLayers.vue	Mon Jul 22 11:20:20 2019 +0200
+++ b/client/src/components/systemconfiguration/MapLayers.vue	Mon Jul 22 13:28:04 2019 +0200
@@ -144,16 +144,22 @@
       this.lookupWMSCapabilities();
     },
     submit() {
-      this.$store.dispatch("application/saveConfig", {
-        ecdis_wms_url: this.config.ecdis_wms_url,
-        ecdis_wms_params: JSON.stringify({
-          LAYERS: this.selectedWMSLayers
-            .filter(l => this.availableWMSLayers.find(al => al === l))
-            .join(","),
-          VERSION: this.wmsVersion,
-          TILED: true
+      const layers = this.selectedWMSLayers
+        .filter(l => this.availableWMSLayers.find(al => al === l))
+        .join(",");
+      const wmsParams = JSON.stringify({
+        LAYERS: layers,
+        VERSION: this.wmsVersion,
+        TILED: true
+      });
+      this.$store
+        .dispatch("application/saveConfig", {
+          ecdis_wms_url: this.config.ecdis_wms_url,
+          ecdis_wms_params: wmsParams
         })
-      });
+        .then(() => {
+          this.config.ecdis_wms_params = wmsParams;
+        });
     }
   },
   mounted() {