diff --git a/Logic/FeatureSource/GeoJsonSource.ts b/Logic/FeatureSource/GeoJsonSource.ts index 7f17fd8fa6..1000f66b6d 100644 --- a/Logic/FeatureSource/GeoJsonSource.ts +++ b/Logic/FeatureSource/GeoJsonSource.ts @@ -179,7 +179,12 @@ export default class GeoJsonSource implements FeatureSource { } self.seenids.add(feature.properties.id) - newFeatures.push({feature: feature, freshness: time}) + let freshness : Date = time; + if(feature["_timestamp"] !== undefined){ + freshness = new Date(feature["_timestamp"]) + } + + newFeatures.push({feature: feature, freshness: freshness}) } console.log("Downloaded "+newFeatures.length+" new features and "+skipped+" already seen features from "+ url); diff --git a/scripts/generateCache.ts b/scripts/generateCache.ts index 7e626e4f59..8c205d6438 100644 --- a/scripts/generateCache.ts +++ b/scripts/generateCache.ts @@ -156,10 +156,13 @@ async function postProcess(targetdir: string, r: TileRange, theme: LayoutConfig) } } } - const featuresFreshness = geojson.features.map(feature => ({ - freshness: osmTime, - feature: feature - })); + const featuresFreshness = geojson.features.map(feature => { + feature["_timestamp"] = rawOsm.osm3s.timestamp_osm_base; + return ({ + freshness: osmTime, + feature: feature + }); + }); // Extract the relationship information const relations = ExtractRelations.BuildMembershipTable(ExtractRelations.GetRelationElements(rawOsm)) MetaTagging.addMetatags(featuresFreshness, relations, theme.layers);