Exporting CSV/Geojson now respects filters + refactoring away State.state

This commit is contained in:
Pieter Vander Vennet 2022-02-16 01:34:28 +01:00
parent 5696b80a5e
commit f0675a026b
4 changed files with 97 additions and 23 deletions

View file

@ -345,6 +345,22 @@ export default class FeaturePipeline {
return tiles;
}
public GetAllFeaturesAndMetaWithin(bbox: BBox, layerIdWhitelist?: Set<string>): {features: any[], layer: string}[] {
const self = this
const tiles :{features: any[], layer: string}[]= []
Array.from(this.perLayerHierarchy.keys())
.forEach(key => {
if(layerIdWhitelist !== undefined && !layerIdWhitelist.has(key)){
return;
}
return tiles.push({
layer: key,
features: [].concat(...self.GetFeaturesWithin(key, bbox))
});
})
return tiles;
}
public GetFeaturesWithin(layerId: string, bbox: BBox): any[][] {
if (layerId === "*") {
return this.GetAllFeaturesWithin(bbox)