diff --git a/Logic/FeatureSource/GeoJsonSource.ts b/Logic/FeatureSource/GeoJsonSource.ts index 84a89327e..0c28e1488 100644 --- a/Logic/FeatureSource/GeoJsonSource.ts +++ b/Logic/FeatureSource/GeoJsonSource.ts @@ -168,20 +168,27 @@ export default class GeoJsonSource implements FeatureSource { let i = 0; let skipped = 0; for (const feature of json.features) { - if (feature.properties.id === undefined) { - feature.properties.id = url + "/" + i; + const props = feature.presets + for (const key in props) { + if(typeof props[key] !== "string"){ + props[key] = ""+props[key] + } + } + + if (props.id === undefined) { + props.id = url + "/" + i; feature.id = url + "/" + i; i++; } - if (self.seenids.has(feature.properties.id)) { + if (self.seenids.has(props.id)) { skipped++; continue; } - self.seenids.add(feature.properties.id) + self.seenids.add(props.id) let freshness: Date = time; if (feature.properties["_last_edit:timestamp"] !== undefined) { - freshness = new Date(feature.properties["_last_edit:timestamp"]) + freshness = new Date(props["_last_edit:timestamp"]) } newFeatures.push({feature: feature, freshness: freshness}) diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index 5d55518ba..1f614cfec 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -103,11 +103,10 @@ export default class MetaTagging { if (code === undefined) { continue; } + const func = new Function("feat", "return " + code + ";"); try { - - const f = (featuresPerLayer, feature: any) => { try { let result = func(feature); diff --git a/langs/themes/en.json b/langs/themes/en.json index 2a8c449cd..94eaf954b 100644 --- a/langs/themes/en.json +++ b/langs/themes/en.json @@ -1324,6 +1324,38 @@ "shortDescription": "Map all the trees", "title": "Trees" }, + "uk_addresses": { + "description": "Contribute to OpenStreetMap by filling out address information", + "layers": { + "1": { + "description": "Addresses", + "name": "Known addresses in OSM", + "tagRenderings": { + "0": { + "render": "This address is saved in OpenStreetMap" + }, + "1": { + "mappings": { + "0": { + "then": "This building has no house number" + } + }, + "question": "What is the number of this house?", + "render": "The housenumber is {addr:housenumber}" + }, + "2": { + "question": "What street is this address located in?", + "render": "This address is in street {addr:street}" + } + }, + "title": { + "render": "Known address" + } + } + }, + "shortDescription": "Help to build an open dataset of UK addresses", + "title": "UK Addresses" + }, "waste_basket": { "description": "On this map, you'll find waste baskets near you. If a waste basket is missing on this map, you can add it yourself", "shortDescription": "A map with waste baskets",