Add names to feature sources, fix that old, cached geometries get changed when a newer version is loaded

This commit is contained in:
Pieter Vander Vennet 2021-04-23 12:55:38 +02:00
parent 6234d26bac
commit 141d4db028
14 changed files with 60 additions and 43 deletions

View file

@ -11,6 +11,8 @@ import {TagsFilter} from "../Tags/TagsFilter";
export default class UpdateFromOverpass implements FeatureSource {
public readonly name = "UpdateFromOverpass"
/**
* The last loaded features of the geojson
*/
@ -86,7 +88,7 @@ export default class UpdateFromOverpass implements FeatureSource {
if (layer.doNotDownload) {
continue;
}
if(layer.source.geojsonSource !== undefined){
if (layer.source.geojsonSource !== undefined) {
// Not our responsibility to download this layer!
continue;
}
@ -128,8 +130,8 @@ export default class UpdateFromOverpass implements FeatureSource {
console.log("Still running a query, not updating");
return;
}
if(this.timeout.data > 0){
if (this.timeout.data > 0) {
console.log("Still in timeout - not updating")
return;
}

View file

@ -13,7 +13,7 @@ export default class UpdateTagsFromOsmAPI {
"_last_edit:timestamp",
"_version_number"],
"Information about the last edit of this object. \n\nIMPORTANT: this data is _only_ loaded when the popup is added. This means it should _not_ be used to render icons!",
(feature: any, index: number, freshness: Date) => {/*Do nothing - this is only added for documentation reasons*/
() => {/*Do nothing - this is only added for documentation reasons*/
}
)
@ -28,7 +28,7 @@ export default class UpdateTagsFromOsmAPI {
}
OsmObject.DownloadObject(id, (element: OsmObject, meta: OsmObjectMeta) => {
console.log("Updating element from OSM-API: ", element)
console.debug("Updating tags from the OSM-API: ", element)
const tags = element.tags;