Skip to content

Commit 394dbef

Browse files
committed
Add getFeaturesForLayer$()
1 parent 30bf12b commit 394dbef

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

projects/core/src/lib/components/feature-info/feature-info.service.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ export class FeatureInfoService {
8686
);
8787
}
8888

89+
public getFeaturesForLayer$(coordinates: [ number, number ], selectedLayer: string | null, pointerType?: string): Observable<FeatureInfoResponseModel | null> {
90+
return combineLatest([
91+
this.store$.select(selectVisibleLayersWithAttributes),
92+
this.store$.select(selectVisibleWMSLayersWithoutAttributes),
93+
this.store$.select(selectViewerId),
94+
this.mapService.getMapViewDetails$(),
95+
])
96+
.pipe(
97+
take(1),
98+
switchMap(([ layers, wmsLayers, viewerId, mapViewDetails ]) => {
99+
if (!viewerId) {
100+
return of(null);
101+
}
102+
if (layers.some(l => l.id === selectedLayer)) {
103+
return this.getFeatureInfoFromApi$(selectedLayer!, coordinates, viewerId, mapViewDetails, false, pointerType);
104+
} else if (wmsLayers.some(l => l.id === selectedLayer)) {
105+
return this.getWmsGetFeatureInfo$(selectedLayer!, coordinates);
106+
} else {
107+
return of(null);
108+
}
109+
}),
110+
);
111+
}
112+
89113
public getEditableFeatures$(coordinates: [ number, number ], selectedLayer?: string | null, pointerType?: string): Observable<FeatureInfoResponseModel[]> {
90114
return combineLatest([
91115
this.store$.select(selectEditableLayers),

0 commit comments

Comments
 (0)