From f2df7f6a8fa5eb68da65d6f9300a27f5fc3bafb8 Mon Sep 17 00:00:00 2001 From: Alexandre Caron Date: Mon, 25 Nov 2024 15:19:53 -0500 Subject: [PATCH] fix(geo): workspace link selection feature with it's vector layer (cherry picked from commit 9b477e91bcf8ac814f4b440917aa4c6a3ace7d5f) --- .../workspace/shared/wfs-workspace.service.ts | 18 ++++++++++++++++++ .../workspace/shared/wms-workspace.service.ts | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts b/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts index fb194b323..9e8e8b38e 100644 --- a/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts @@ -21,6 +21,7 @@ import { import { GeoWorkspaceOptions, LayerService, + LinkedProperties, VectorLayer } from '../../layer/shared'; import { IgoMap } from '../../map/shared/map'; @@ -99,8 +100,25 @@ export class WfsWorkspaceService { const confQueryOverlayStyle: OverlayStyleOptions = this.configService.getConfig('queryOverlayStyle'); + const id = layer.id + '.FeatureStore'; + + if (!layer.link) { + layer.options.linkedLayers.links = [ + { + syncedDelete: true, + linkedIds: [id], + properties: [LinkedProperties.VISIBLE] + } + ]; + layer.createLink(); + } + const selectionStrategy = new FeatureStoreSelectionStrategy({ layer: new VectorLayer({ + id, + linkedLayers: { + linkId: id + }, zIndex: 300, source: new FeatureDataSource(), style: (feature) => { diff --git a/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts b/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts index 9da838495..5691cab65 100644 --- a/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts @@ -256,8 +256,25 @@ export class WmsWorkspaceService { const confQueryOverlayStyle: OverlayStyleOptions = this.configService.getConfig('queryOverlayStyle'); + const id = layer.id + '.FeatureStore'; + + if (!layer.link) { + layer.options.linkedLayers.links = [ + { + syncedDelete: true, + linkedIds: [id], + properties: [LinkedProperties.VISIBLE] + } + ]; + layer.createLink(); + } + const selectionStrategy = new FeatureStoreSelectionStrategy({ layer: new VectorLayer({ + id, + linkedLayers: { + linkId: id + }, zIndex: 300, source: new FeatureDataSource(), style: (feature) => {