comparison client/src/components/systemconfiguration/ColorSettings.vue @ 4320:baa3759f27f4

client: opacity for WMS-Layers
author Fadi Abbud <fadi.abbud@intevation.de>
date Wed, 04 Sep 2019 12:40:21 +0200
parents edfafea4b7b0
children 3f0422751cb4
comparison
equal deleted inserted replaced
4319:0d516bac1aae 4320:baa3759f27f4
24 > 24 >
25 </div> 25 </div>
26 <div class="card-body p-0"> 26 <div class="card-body p-0">
27 <chrome-picker 27 <chrome-picker
28 v-model="f.strokeColor" 28 v-model="f.strokeColor"
29 :class="{ hide: f.noOpacity }" 29 :class="{
30 hide:
31 f.noOpacity ||
32 f.name === 'Distance Marks' ||
33 f.name === 'Distance Marks, Axis'
34 }"
30 /> 35 />
31 </div> 36 </div>
32 </div> 37 </div>
33 </div> 38 </div>
34 <div class="mt-2"> 39 <div class="mt-2">
142 strokeColor: initSColor 147 strokeColor: initSColor
143 }, 148 },
144 { 149 {
145 name: "Distance Marks, Axis", 150 name: "Distance Marks, Axis",
146 strokeColor: initSColor, 151 strokeColor: initSColor,
147 fillColor: initSColor, 152 fillColor: initSColor
148 noOpacity: true
149 }, 153 },
150 { 154 {
151 name: "Distance Marks", 155 name: "Distance Marks",
152 strokeColor: initSColor, 156 strokeColor: initSColor,
153 fillColor: initSColor, 157 fillColor: initSColor
154 noOpacity: true
155 }, 158 },
156 { 159 {
157 name: "Waterway profiles", 160 name: "Waterway profiles",
158 strokeColor: initSColor 161 strokeColor: initSColor
159 }, 162 },
258 fillC = feature.fillColor 261 fillC = feature.fillColor
259 ? feature.fillColor.hex8 || feature.fillColor 262 ? feature.fillColor.hex8 || feature.fillColor
260 : initFColor; 263 : initFColor;
261 // Now we do not handle alpha-color value for WMS-Layers 264 // Now we do not handle alpha-color value for WMS-Layers
262 // ToDo: implementation in front-backend. 265 // ToDo: implementation in front-backend.
263 let strokeCForWMS = feature.strokeColor.hex || feature.strokeColor, 266 let strokeCForWMS = feature.strokeColor.hex || feature.strokeColor;
264 fillCForWMS = feature.fillColor
265 ? feature.fillColor.hex || feature.fillColor
266 : initFColor;
267 let noChangeMsg = name => { 267 let noChangeMsg = name => {
268 displayInfo({ 268 displayInfo({
269 title: name + ":", 269 title: name + ":",
270 message: this.$gettext("No style-changes") 270 message: this.$gettext("No style-changes")
271 }); 271 });
411 break; 411 break;
412 } 412 }
413 case "Distance Marks, Axis": { 413 case "Distance Marks, Axis": {
414 if ( 414 if (
415 strokeCForWMS !== this.config.distance_marks_stroke || 415 strokeCForWMS !== this.config.distance_marks_stroke ||
416 fillCForWMS !== this.config.distance_marks_fill 416 fillC !== this.config.distance_marks_fill
417 ) { 417 ) {
418 this.$store 418 this.$store
419 .dispatch("application/saveConfig", { 419 .dispatch("application/saveConfig", {
420 distance_marks_stroke: strokeCForWMS, 420 distance_marks_stroke: strokeCForWMS,
421 distance_marks_fill: fillCForWMS 421 distance_marks_fill: fillC
422 }) 422 })
423 .finally(() => this.$store.dispatch("application/loadConfig")); 423 .finally(() => this.$store.dispatch("application/loadConfig"));
424 } else { 424 } else {
425 noChangeMsg(feature.name); 425 noChangeMsg(feature.name);
426 } 426 }
427 break; 427 break;
428 } 428 }
429 case "Distance Marks": { 429 case "Distance Marks": {
430 if ( 430 if (
431 strokeCForWMS !== this.config.distance_marks_ashore_stroke || 431 strokeCForWMS !== this.config.distance_marks_ashore_stroke ||
432 fillCForWMS !== this.config.distance_marks_ashore_fill 432 fillC !== this.config.distance_marks_ashore_fill
433 ) { 433 ) {
434 this.$store 434 this.$store
435 .dispatch("application/saveConfig", { 435 .dispatch("application/saveConfig", {
436 distance_marks_ashore_stroke: strokeCForWMS, 436 distance_marks_ashore_stroke: strokeCForWMS,
437 distance_marks_ashore_fill: fillCForWMS 437 distance_marks_ashore_fill: fillC
438 }) 438 })
439 .finally(() => this.$store.dispatch("application/loadConfig")); 439 .finally(() => this.$store.dispatch("application/loadConfig"));
440 } else { 440 } else {
441 noChangeMsg(feature.name); 441 noChangeMsg(feature.name);
442 } 442 }