From bd58adc3730439e3b201a4b163d7c29f834d9a50 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 5 Nov 2024 13:52:23 +0100 Subject: [PATCH] Studio: fix failing detection, add error message after reddit post --- src/Logic/Tags/Tag.ts | 6 +++++- src/Models/ThemeConfig/Conversion/PrevalidateLayer.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Logic/Tags/Tag.ts b/src/Logic/Tags/Tag.ts index b4de292919..e7f0f269f3 100644 --- a/src/Logic/Tags/Tag.ts +++ b/src/Logic/Tags/Tag.ts @@ -170,8 +170,12 @@ export class Tag extends TagsFilter { return this } + /** + * new Tag("panoramax", "").isNegative() // => true + * new Tag("x","y").isNegative() // => false + */ isNegative(): boolean { - return false + return this.value === "" } visit(f: (tagsFilter: TagsFilter) => void) { diff --git a/src/Models/ThemeConfig/Conversion/PrevalidateLayer.ts b/src/Models/ThemeConfig/Conversion/PrevalidateLayer.ts index ed1989778c..ca5245cf98 100644 --- a/src/Models/ThemeConfig/Conversion/PrevalidateLayer.ts +++ b/src/Models/ThemeConfig/Conversion/PrevalidateLayer.ts @@ -69,7 +69,7 @@ export class PrevalidateLayer extends DesugaringStep { context .enters("source", "osmTags") .err( - "The source states tags which give a very wide selection: it only uses negative expressions, which will result in too much and unexpected data. Add at least one required tag. The tags are:\n\t" + + "The tags that will be used to load data from OpenStreetMap are all negative - this means that they all match something that _doesn't_ have a certain tag. For example, `key=` means anything without `key`. Did you perhaps mean to use `key~*`, meaning anything _with_ this key set? The tags are:\n\t" + osmTags.asHumanString(false, false, {}) ) }