forked from MapComplete/MapComplete
Feature(imagequeue): (hopefully) handle some edge cases correctly
This commit is contained in:
parent
6925b3d26e
commit
aa373ee698
4 changed files with 21 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
|||
import { FeatureSource } from "../FeatureSource"
|
||||
import { UIEventSource } from "../../UIEventSource"
|
||||
import { OsmTags } from "../../../Models/OsmFeature"
|
||||
|
||||
/**
|
||||
* Constructs a UIEventStore for the properties of every Feature, indexed by id
|
||||
|
@ -58,7 +57,7 @@ export default class FeaturePropertiesStore {
|
|||
return store
|
||||
}
|
||||
|
||||
public trackFeature(feature: { properties: OsmTags }) {
|
||||
public trackFeature(feature: { properties: Record<string, string> }) {
|
||||
const id = feature.properties.id
|
||||
if (id === undefined) {
|
||||
console.trace("Error: feature without ID:", feature)
|
||||
|
@ -67,7 +66,7 @@ export default class FeaturePropertiesStore {
|
|||
|
||||
const source = this._elements.get(id)
|
||||
if (source === undefined) {
|
||||
this._elements.set(id, new UIEventSource<any>(feature.properties))
|
||||
this._elements.set(id, new UIEventSource<Record<string, string>>(feature.properties))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue