forked from MapComplete/MapComplete
Extract and validate images using a new conversion, regenerate docs
This commit is contained in:
parent
5198f5d310
commit
b3c58ae82e
52 changed files with 8611 additions and 3408 deletions
|
@ -10,17 +10,20 @@ export default class StaticFeatureSource implements FeatureSource {
|
|||
|
||||
constructor(features: any[] | UIEventSource<any[] | UIEventSource<{ feature: any, freshness: Date }>>, useFeaturesDirectly) {
|
||||
const now = new Date();
|
||||
if(features === undefined){
|
||||
throw "Static feature source received undefined as source"
|
||||
}
|
||||
if (useFeaturesDirectly) {
|
||||
// @ts-ignore
|
||||
this.features = features
|
||||
} else if (features instanceof UIEventSource) {
|
||||
// @ts-ignore
|
||||
this.features = features.map(features => features.map(f => ({feature: f, freshness: now})))
|
||||
this.features = features.map(features => features?.map(f => ({feature: f, freshness: now}) ?? []))
|
||||
} else {
|
||||
this.features = new UIEventSource(features.map(f => ({
|
||||
this.features = new UIEventSource(features?.map(f => ({
|
||||
feature: f,
|
||||
freshness: now
|
||||
})))
|
||||
}))??[])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue