Do not show out-of-range features on speelplekken layer, fix handling of mutlipolygons in 'inside', better tests

This commit is contained in:
Pieter Vander Vennet 2021-05-14 02:25:30 +02:00
parent 117b0bddb1
commit 6f457a6f0d
26 changed files with 1284 additions and 770 deletions

View file

@ -26,7 +26,6 @@ export default class MetaTagging {
layers: LayerConfig[],
includeDates = true) {
console.debug("Adding meta tags to all features")
for (const metatag of SimpleMetaTagger.metatags) {
if (metatag.includesDates && !includeDates) {
// We do not add dated entries
@ -95,9 +94,17 @@ export default class MetaTagging {
const f = (featuresPerLayer, feature: any) => {
try {
feature.properties[key] =func(feature);
let result = func(feature);
if(result === undefined || result === ""){
return;
}
if(typeof result !== "string"){
// Make sure it is a string!
result = "" + result;
}
feature.properties[key] = result;
} catch (e) {
console.error("Could not calculate a metatag 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")
console.error("Could not calculate a metatag 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)
}
}