From f0c33d5d871b8e43a6e6fca314ecd726803f4b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 20 Feb 2020 07:29:34 -0500 Subject: [PATCH] fix(ogc-filter, style): better handling grouped layers (#581) * fix(*) better handling grouped layers * refactor(share-map) Rollback for grouped layers --- packages/geo/src/lib/filter/shared/ogc-filter.ts | 1 + .../src/lib/layer/layer-legend/layer-legend.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/geo/src/lib/filter/shared/ogc-filter.ts b/packages/geo/src/lib/filter/shared/ogc-filter.ts index f84d78790..155e52a10 100644 --- a/packages/geo/src/lib/filter/shared/ogc-filter.ts +++ b/packages/geo/src/lib/filter/shared/ogc-filter.ts @@ -536,6 +536,7 @@ export class OgcFilterWriter { appliedFilter = `${appliedFilter}(${processedFilter.replace('filter=', '')})`; }); } + appliedFilter = appliedFilter.replace(/\(\)/g, ''); const filterValue = appliedFilter.length > 0 ? appliedFilter.replace('filter=', '') : undefined; return filterValue; } diff --git a/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts b/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts index 9a5f9506a..ff0666989 100644 --- a/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts +++ b/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts @@ -172,7 +172,12 @@ export class LayerLegendComponent implements OnInit, OnDestroy { onChangeStyle() { this.updateLegend(); - this.layer.dataSource.ol.updateParams({STYLES: this.currentStyle}); + let STYLES = ''; + this.layer.dataSource.ol.getParams().LAYERS.split(',').map(layer => + STYLES += this.currentStyle + ',' + ); + STYLES = STYLES.slice(0, -1); + this.layer.dataSource.ol.updateParams({STYLES}); } onLoadImage(id: string) {