Refactoring: tweak some featuresources to allow them to run in the tests

This commit is contained in:
Pieter Vander Vennet 2023-05-17 13:19:43 +02:00
parent ad1178df6c
commit 39aff86c76
3 changed files with 15 additions and 4 deletions

View file

@ -1,8 +1,8 @@
import { FeatureSource, IndexedFeatureSource } from "./FeatureSource"
import {FeatureSource} from "./FeatureSource"
import FilteredLayer from "../../Models/FilteredLayer"
import SimpleFeatureSource from "./Sources/SimpleFeatureSource"
import { Feature } from "geojson"
import { UIEventSource } from "../UIEventSource"
import {Feature} from "geojson"
import {UIEventSource} from "../UIEventSource"
/**
* In some rare cases, some elements are shown on multiple layers (when 'passthrough' is enabled)
@ -59,6 +59,10 @@ export default class PerLayerFeatureSourceSplitter<T extends FeatureSource = Fea
let foundALayer = false
for (let i = 0; i < layers.length; i++) {
const layer = layers[i]
if(!layer.layerDef?.source){
console.error("PerLayerFeatureSourceSplitter got a layer without a source:", layer.layerDef.id)
continue
}
if (layer.layerDef.source.osmTags.matchesProperties(f.properties)) {
const id = f.properties.id
// We have found our matching layer!