comparison 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
comparison
equal deleted inserted replaced
4021:b10f210af325 4022:efe0904b1d45
142 let ecdisWmsParams = JSON.parse(defaults.ecdis_wms_params); 142 let ecdisWmsParams = JSON.parse(defaults.ecdis_wms_params);
143 this.selectedWMSLayers = ecdisWmsParams.LAYERS.split(","); 143 this.selectedWMSLayers = ecdisWmsParams.LAYERS.split(",");
144 this.lookupWMSCapabilities(); 144 this.lookupWMSCapabilities();
145 }, 145 },
146 submit() { 146 submit() {
147 this.$store.dispatch("application/saveConfig", { 147 const layers = this.selectedWMSLayers
148 ecdis_wms_url: this.config.ecdis_wms_url, 148 .filter(l => this.availableWMSLayers.find(al => al === l))
149 ecdis_wms_params: JSON.stringify({ 149 .join(",");
150 LAYERS: this.selectedWMSLayers 150 const wmsParams = JSON.stringify({
151 .filter(l => this.availableWMSLayers.find(al => al === l)) 151 LAYERS: layers,
152 .join(","), 152 VERSION: this.wmsVersion,
153 VERSION: this.wmsVersion, 153 TILED: true
154 TILED: true 154 });
155 this.$store
156 .dispatch("application/saveConfig", {
157 ecdis_wms_url: this.config.ecdis_wms_url,
158 ecdis_wms_params: wmsParams
155 }) 159 })
156 }); 160 .then(() => {
161 this.config.ecdis_wms_params = wmsParams;
162 });
157 } 163 }
158 }, 164 },
159 mounted() { 165 mounted() {
160 let ecdisWmsParams = JSON.parse(this.config.ecdis_wms_params); 166 let ecdisWmsParams = JSON.parse(this.config.ecdis_wms_params);
161 if (ecdisWmsParams.LAYERS) { 167 if (ecdisWmsParams.LAYERS) {