diff --git a/src/Logic/Tags/Tag.ts b/src/Logic/Tags/Tag.ts index b4de29291..e7f0f269f 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 ed1989778..ca5245cf9 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, {}) ) }