From 2a948dfe7b48db5cd10ad8756a825d26038339fd Mon Sep 17 00:00:00 2001 From: Filip Leitner Date: Mon, 12 Feb 2024 11:49:10 +0100 Subject: [PATCH] refactor(styler): Opacity fix not necessary anymore --- .../components/styler/rule/rule.component.ts | 2 +- .../fill-symbolizer.component.html | 8 ++++---- .../fill-symbolizer.component.ts | 4 ---- .../hslayers/shared/styler/styler.service.ts | 19 ------------------- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/projects/hslayers/components/styler/rule/rule.component.ts b/projects/hslayers/components/styler/rule/rule.component.ts index ede657423c..35c842035f 100644 --- a/projects/hslayers/components/styler/rule/rule.component.ts +++ b/projects/hslayers/components/styler/rule/rule.component.ts @@ -36,7 +36,7 @@ export class HsRuleComponent extends HsStylerPartBaseComponent { if (kind === Kinds.fill) { Object.assign(symbolizer, { outlineColor: '#ffffff', - opacity: 1, + fillOpacity: 1, outlineOpacity: 0.5, outlineWidth: 2, }); diff --git a/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.html b/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.html index a2939c00ed..4917c69bbe 100644 --- a/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.html +++ b/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.html @@ -1,14 +1,14 @@
- ! - + diff --git a/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.ts b/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.ts index 67430db513..5c5d7f710d 100644 --- a/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.ts +++ b/projects/hslayers/components/styler/symbolizers/fill-symbolizer/fill-symbolizer.component.ts @@ -44,8 +44,4 @@ export class HsFillSymbolizerComponent extends HsStylerPartBaseComponent { this.menuRef.close(); this.emitChange(); } - - opacityFix(): void { - this.symbolizer.fillOpacity = this.symbolizer.opacity; - } } diff --git a/projects/hslayers/shared/styler/styler.service.ts b/projects/hslayers/shared/styler/styler.service.ts index 54bfe2d128..922de868b9 100644 --- a/projects/hslayers/shared/styler/styler.service.ts +++ b/projects/hslayers/shared/styler/styler.service.ts @@ -374,7 +374,6 @@ export class HsStylerService { this.styleObject = blankStyleObj; } this.fixSymbolizerBugs(this.styleObject); - this.geostylerWorkaround(); /** * Save (update OL style) layer style * unsavedChange - synced layman layer with changes @@ -406,24 +405,6 @@ export class HsStylerService { } } - /** - * Tweak geostyler object attributes to mitigate - * some discrepancies between opacity and fillOpacity usage - */ - geostylerWorkaround(): void { - if (this.styleObject.rules) { - for (const rule of this.styleObject.rules) { - if (rule.symbolizers) { - for (const symbol of rule.symbolizers.filter( - (symb) => symb.kind == 'Fill', - ) as FillSymbolizer[]) { - symbol.opacity = symbol.fillOpacity; - } - } - } - } - } - /** * Convert SLD to OL style object */