forked from MapComplete/MapComplete
Refactoring: fix download buttons
This commit is contained in:
parent
8a1f0599d9
commit
ef0ec5160d
10 changed files with 142 additions and 134 deletions
|
@ -23,7 +23,7 @@ export default class GeoIndexedStore implements FeatureSource {
|
|||
* @param bbox
|
||||
* @constructor
|
||||
*/
|
||||
public GetFeaturesWithin(bbox: BBox): Feature[] {
|
||||
public GetFeaturesWithin(bbox: BBox, strict: boolean = false): Feature[] {
|
||||
// TODO optimize
|
||||
const bboxFeature = bbox.asGeojsonCached()
|
||||
return this.features.data.filter((f) => {
|
||||
|
|
|
@ -54,7 +54,6 @@ export default class FilteringFeatureSource implements FeatureSource {
|
|||
|
||||
this.update()
|
||||
}
|
||||
|
||||
private update() {
|
||||
const self = this
|
||||
const layer = this._layer
|
||||
|
@ -64,26 +63,9 @@ export default class FilteringFeatureSource implements FeatureSource {
|
|||
const newFeatures = (features ?? []).filter((f) => {
|
||||
self.registerCallback(f)
|
||||
|
||||
const isShown: TagsFilter = layer.layerDef.isShown
|
||||
const tags = f.properties
|
||||
if (isShown !== undefined && !isShown.matchesProperties(tags)) {
|
||||
if (!layer.isShown(f.properties, globalFilters)) {
|
||||
return false
|
||||
}
|
||||
if (tags._deleted === "yes") {
|
||||
return false
|
||||
}
|
||||
|
||||
let neededTags: TagsFilter = layer.currentFilter.data
|
||||
if (neededTags !== undefined && !neededTags.matchesProperties(f.properties)) {
|
||||
return false
|
||||
}
|
||||
|
||||
for (const globalFilter of globalFilters ?? []) {
|
||||
const neededTags = globalFilter.osmTags
|
||||
if (neededTags !== undefined && !neededTags.matchesProperties(f.properties)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
includedFeatureIds.add(f.properties.id)
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue