forked from MapComplete/MapComplete
Fixes to wayhandling
This commit is contained in:
parent
032bf89017
commit
813e96f8df
4 changed files with 17 additions and 16 deletions
|
@ -140,21 +140,24 @@ export class FilteredLayer {
|
|||
const selfFeatures = [];
|
||||
for (let feature of geojson.features) {
|
||||
// feature.properties contains all the properties
|
||||
|
||||
|
||||
const tags = TagUtils.proprtiesToKV(feature.properties);
|
||||
const centerPoint = GeoOperations.centerpoint(feature);
|
||||
|
||||
if (!this.filters.matches(tags)) {
|
||||
leftoverFeatures.push(feature);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (feature.geometry.type !== "Point") {
|
||||
const centerPoint = GeoOperations.centerpoint(feature);
|
||||
if (this._wayHandling === LayerConfig.WAYHANDLING_CENTER_AND_WAY) {
|
||||
selfFeatures.push(centerPoint);
|
||||
} else if (this._wayHandling === LayerConfig.WAYHANDLING_CENTER_ONLY) {
|
||||
feature = centerPoint;
|
||||
}
|
||||
}
|
||||
if (this.filters.matches(tags)) {
|
||||
selfFeatures.push(feature);
|
||||
} else {
|
||||
leftoverFeatures.push(feature);
|
||||
}
|
||||
selfFeatures.push(feature);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue