Add detection for negative tagging in layers, fix issue with 'key!=' being interpreted as 'key!=*', add tests

This commit is contained in:
Pieter Vander Vennet 2022-03-31 02:44:23 +02:00
parent 360f83f04f
commit b5e289764e
10 changed files with 49 additions and 3 deletions

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.17.0";
public static vNumber = "0.17.1";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -101,6 +101,10 @@ export default class LayerConfig extends WithContextLoader {
context + "source.osmTags"
);
if(Constants.priviliged_layers.indexOf(this.id) < 0 && osmTags.isNegative()){
throw context + "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"+osmTags.asHumanString(false, false, {});
}
if (json.source["geoJsonSource"] !== undefined) {
throw context + "Use 'geoJson' instead of 'geoJsonSource'";
}
@ -108,6 +112,7 @@ export default class LayerConfig extends WithContextLoader {
if (json.source["geojson"] !== undefined) {
throw context + "Use 'geoJson' instead of 'geojson' (the J is a capital letter)";
}
this.source = new SourceConfig(
{