From 712806c682aa53480b99043f3c6664394732ed01 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 24 Mar 2022 03:11:52 +0100 Subject: [PATCH] More test refactoring --- Models/ThemeConfig/Conversion/FixImages.ts | 38 + Models/ThemeConfig/Conversion/PrepareLayer.ts | 2 + assets/layoutconfigmeta.json | 4933 +++++++++++++++++ package-lock.json | 26 +- .../Conversion/PrepareLayer.spec.ts | 130 +- 5 files changed, 5063 insertions(+), 66 deletions(-) diff --git a/Models/ThemeConfig/Conversion/FixImages.ts b/Models/ThemeConfig/Conversion/FixImages.ts index 191de56e6..cdda7ff46 100644 --- a/Models/ThemeConfig/Conversion/FixImages.ts +++ b/Models/ThemeConfig/Conversion/FixImages.ts @@ -29,6 +29,44 @@ export class ExtractImages extends Conversion { } /** + * const images = new ExtractImages(true, new Map()).convert({ + * "layers": [ + * { + * tagRenderings: [ + * { + * "mappings": [ + * { + * "if": "bicycle_parking=stands", + * "then": { + * "en": "Staple racks", + * }, + * "icon": { + * path: "./assets/layers/bike_parking/staple.svg", + * class: "small" + * } + * }, + * { + * "if": "bicycle_parking=stands", + * "then": { + * "en": "Bollard", + * }, + * "icon": "./assets/layers/bike_parking/bollard.svg", + * } + * ] + * } + * ] + * } + * ] + * }, "test").result; + * images.length // => 2 + * images.findIndex(img => img == "./assets/layers/bike_parking/staple.svg") // => 0 + * images.findIndex(img => img == "./assets/layers/bike_parking/bollard.svg") // => 1 + * + * // should not pickup rotation, should drop color + * const images = new ExtractImages(true, new Map()).convert({"layers": [{mapRendering: [{"location": ["point", "centroid"],"icon": "pin:black",rotation: 180,iconSize: "40,40,center"}]}] + * }, "test").result + * images.length // => 1 + * images[0] // => "pin" * */ convert(json: LayoutConfigJson, context: string): { result: string[], errors: string[], warnings: string[] } { diff --git a/Models/ThemeConfig/Conversion/PrepareLayer.ts b/Models/ThemeConfig/Conversion/PrepareLayer.ts index 6b02e70e9..195853577 100644 --- a/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -366,6 +366,8 @@ class ExpandRewriteWithFlatten extends Conversion { + + constructor(state: DesugaringContext) { super( "Fully prepares and expands a layer for the LayerConfig.", diff --git a/assets/layoutconfigmeta.json b/assets/layoutconfigmeta.json index 0e9b3bc51..d8bc6cfbb 100644 --- a/assets/layoutconfigmeta.json +++ b/assets/layoutconfigmeta.json @@ -902,6 +902,9 @@ }, { "$ref": "#/definitions/default_5" + }, + { + "$ref": "#/definitions/default" } ] } @@ -3185,6 +3188,4929 @@ ], "type": "string" }, + { + "path": [ + "layers", + "mapRendering" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "location" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then" + ], + "typeHint": "icon", + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": [ + "string", + "number" + ] + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "enum": [ + "no", + "yes" + ], + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "number" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "color", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": [ + "string", + "number" + ] + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "width", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "dashArray", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "lineCap", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "enum": [ + "no", + "yes" + ], + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fill", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "fillColor", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "number" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "offset", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "location" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "icon", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then" + ], + "typeHint": "icon", + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconBadges", + "then", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "iconSize", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "rotation", + "mappings", + "icon", + "class" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label" + ], + "type": [ + { + "$ref": "#/definitions/TagRenderingConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "id" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "group" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "labels" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "render" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "condition" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "freeform" + ], + "type": "object" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "freeform", + "key" + ], + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings" + ], + "type": "array" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "if" + ], + "type": [ + { + "$ref": "#/definitions/AndOrTagConfigJson" + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "then" + ], + "typeHint": "rendered" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon" + ], + "typeHint": "icon", + "type": [ + { + "type": "object", + "properties": { + "path": { + "description": "The path to the icon\nType: icon", + "type": "string" + }, + "class": { + "description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)", + "type": "string" + } + }, + "required": [ + "class", + "path" + ] + }, + { + "type": "string" + } + ] + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon", + "path" + ], + "typeHint": "icon", + "type": "string" + }, + { + "path": [ + "layers", + "mapRendering", + "renderings", + "label", + "mappings", + "icon", + "class" + ], + "type": "string" + }, { "path": [ "layers", @@ -3605,6 +8531,13 @@ } ] }, + { + "path": [ + "layers", + "tagRenderings" + ], + "type": "object" + }, { "path": [ "layers", diff --git a/package-lock.json b/package-lock.json index 061a7938b..123f0039a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4414,13 +4414,19 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001259", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001259.tgz", - "integrity": "sha512-V7mQTFhjITxuk9zBpI6nYsiTXhcPe05l+364nZjK7MFK/E7ibvYBSAXr4YcA6oPR8j3ZLM/LN+lUqUVAQEUZFg==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "version": "1.0.30001319", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", + "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, "node_modules/canvg": { "version": "3.0.7", @@ -20424,9 +20430,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001259", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001259.tgz", - "integrity": "sha512-V7mQTFhjITxuk9zBpI6nYsiTXhcPe05l+364nZjK7MFK/E7ibvYBSAXr4YcA6oPR8j3ZLM/LN+lUqUVAQEUZFg==" + "version": "1.0.30001319", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", + "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==" }, "canvg": { "version": "3.0.7", diff --git a/tests/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts b/tests/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts index 6b6043491..b87a683cd 100644 --- a/tests/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts +++ b/tests/Models/ThemeConfig/Conversion/PrepareLayer.spec.ts @@ -9,67 +9,85 @@ import * as bookcaseLayer from "../../../../assets/generated/layers/public_bookc import LayerConfig from "../../../../Models/ThemeConfig/LayerConfig"; import {ExtractImages} from "../../../../Models/ThemeConfig/Conversion/FixImages"; import * as cyclofix from "../../../../assets/generated/themes/cyclofix.json" +import LineRenderingConfigJson from "../../../../Models/ThemeConfig/Json/LineRenderingConfigJson"; +import {PrepareLayer} from "../../../../Models/ThemeConfig/Conversion/PrepareLayer"; -const themeConfigJson: LayoutConfigJson = { + +describe("PrepareLayer", () => { - description: "Descr", - icon: "", - layers: [ - { - builtin: "public_bookcase", - override: { + it("should expand mappings in map renderings", () => { + const exampleLayer: LayerConfigJson = { + id: "testlayer", source: { - geoJson: "xyz" - } + osmTags: "key=value" + }, + mapRendering: [ + { + "rewrite": { + sourceString: ["left|right", "lr_offset"], + into: [ + ["left", "right"], + [-6, +6] + ] + }, + renderings: { + "color": { + "render": "#888", + "mappings": [ + { + "if": "parking:condition:left|right=free", + "then": "#299921" + }, + { + "if": "parking:condition:left|right=disc", + "then": "#219991" + } + ] + }, + "offset": "lr_offset" + } + } + ] } + const prep = new PrepareLayer({ + tagRenderings: new Map(), + sharedLayers: new Map() + }) + const result = prep.convertStrict(exampleLayer, "test") + + const expected = { + "id": "testlayer", + "source": {"osmTags": "key=value"}, + "mapRendering": [{ + "color": { + "render": "#888", + "mappings": [{ + "if": "parking:condition:left=free", + "then": "#299921" + }, + {"if": "parking:condition:left=disc", + "then": "#219991"}] + }, + "offset": -6 + }, { + "color": { + "render": "#888", + "mappings": [{ + "if": "parking:condition:right=free", + "then": "#299921" + }, + {"if": "parking:condition:right=disc", + "then": "#219991"}] + }, + "offset": 6 + }], + "titleIcons": [{"render": "defaults", "id": "defaults"}] + } + + + expect(result).deep.eq(expected) } - ], - maintainer: "", - startLat: 0, - startLon: 0, - startZoom: 0, - title: { - en: "Title" - }, - version: "", - id: "test" -} - -describe("PrepareTheme", () => { - - it("should apply overrideAll", () => { - - const sharedLayers = new Map() - sharedLayers.set("public_bookcase", bookcaseLayer["default"]) - let themeConfigJsonPrepared = new PrepareTheme({ - tagRenderings: new Map(), - sharedLayers: sharedLayers - }).convert( themeConfigJson, "test").result - const themeConfig = new LayoutConfig(themeConfigJsonPrepared); - const layerUnderTest = themeConfig.layers.find(l => l.id === "public_bookcase") - expect(layerUnderTest.source.geojsonSource).eq("xyz") - - }) + ) }) - -describe("ExtractImages", () => { - it("should find all images in a themefile", () => { - const images = new Set(new ExtractImages(true, new Map()).convertStrict( cyclofix, "test")) - const expectedValues = [ - './assets/layers/bike_repair_station/repair_station.svg', - './assets/layers/bike_repair_station/repair_station_pump.svg', - './assets/layers/bike_repair_station/broken_pump.svg', - './assets/layers/bike_repair_station/pump.svg', - './assets/themes/cyclofix/fietsambassade_gent_logo_small.svg', - './assets/layers/bike_repair_station/pump_example_manual.jpg', - './assets/layers/bike_repair_station/pump_example.png', - './assets/layers/bike_repair_station/pump_example_round.jpg', - './assets/layers/bike_repair_station/repair_station_example_2.jpg', - 'close'] - for (const expected of expectedValues) { - expect(images).contains(expected) - } - }) -}) \ No newline at end of file