From f749cb0963c63341d1b566a9b7237a776f1c4065 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 26 Sep 2021 17:49:47 +0200 Subject: [PATCH] Small changes --- Logic/MetaTagging.ts | 5 +---- assets/layers/drinking_water/drinking_water.json | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index c7eda184b..c02ed04e4 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -111,13 +111,11 @@ export default class MetaTagging { d = JSON.stringify(d); } feature.properties[key] = d; - console.log("Written a delayed calculated tag onto ", feature.properties.id, ": ", key, ":==", d) }) result = result.data } if (result === undefined || result === "") { - console.log("Calculated tag for", key, "gave undefined", feature.properties.id) return; } if (typeof result !== "string") { @@ -125,10 +123,9 @@ export default class MetaTagging { result = JSON.stringify(result); } feature.properties[key] = result; - console.log("Written a calculated tag onto ", feature.properties.id, ": ", key, ":==", result) } catch (e) { if (MetaTagging.errorPrintCount < MetaTagging.stopErrorOutputAt) { - console.warn("Could not calculate a calculated tag defined by " + code + " due to " + e + ". This is code defined in the theme. Are you the theme creator? Doublecheck your code. Note that the metatags might not be stable on new features", e) + console.warn("Could not calculate a calculated tag defined by " + code + " due to " + e + ". This is code defined in the theme. Are you the theme creator? Doublecheck your code. Note that the metatags might not be stable on new features", e,e.stack) MetaTagging.errorPrintCount++; if (MetaTagging.errorPrintCount == MetaTagging.stopErrorOutputAt) { console.error("Got ", MetaTagging.stopErrorOutputAt, " errors calculating this metatagging - stopping output now") diff --git a/assets/layers/drinking_water/drinking_water.json b/assets/layers/drinking_water/drinking_water.json index 8b0651933..abd282403 100644 --- a/assets/layers/drinking_water/drinking_water.json +++ b/assets/layers/drinking_water/drinking_water.json @@ -48,9 +48,9 @@ } }, "calculatedTags": [ - "_closest_other_drinking_water=feat.closestn('drinking_water', 1, 500).map(f => ({id: f.feat.id, distance: f.distance}))[0]", + "_closest_other_drinking_water=feat.closestn('drinking_water', 1, undefined, 5000).map(f => ({id: f.feat.id, distance: ''+f.distance}))[0]", "_closest_other_drinking_water_id=JSON.parse(feat.properties._closest_other_drinking_water)?.id", - "_closest_other_drinking_water_distance=Math.floor(JSON.parse(feat.properties._closest_other_drinking_water)?.distance * 1000)" + "_closest_other_drinking_water_distance=Math.floor(Number(JSON.parse(feat.properties._closest_other_drinking_water)?.distance) * 1000)" ], "minzoom": 13, "wayHandling": 1,