diff --git a/Customizations/JSON/LayoutConfig.ts b/Customizations/JSON/LayoutConfig.ts index e76c68ac8..511f1ff18 100644 --- a/Customizations/JSON/LayoutConfig.ts +++ b/Customizations/JSON/LayoutConfig.ts @@ -95,7 +95,7 @@ export default class LayoutConfig { } ); this.defaultBackgroundId = json.defaultBackgroundId; - this.layers = LayoutConfig.ExtractLayers(json, this.units, official); + this.layers = LayoutConfig.ExtractLayers(json, this.units, official, context); // ALl the layers are constructed, let them share tags in now! const roaming: { r, source: LayerConfig }[] = [] @@ -160,12 +160,12 @@ export default class LayoutConfig { } - private static ExtractLayers(json: LayoutConfigJson, units: Unit[], official: boolean): LayerConfig[] { + private static ExtractLayers(json: LayoutConfigJson, units: Unit[], official: boolean, context: string): LayerConfig[] { const result: LayerConfig[] = [] json.layers.forEach((layer, i) => { if (typeof layer === "string") { - if (AllKnownLayers.sharedLayersJson[layer] !== undefined) { + if (AllKnownLayers.sharedLayersJson.get(layer) !== undefined) { if (json.overrideAll !== undefined) { let lyr = JSON.parse(JSON.stringify(AllKnownLayers.sharedLayersJson[layer])); const newLayer = new LayerConfig(Utils.Merge(json.overrideAll, lyr), units, `${json.id}+overrideAll.layers[${i}]`, official) @@ -176,7 +176,8 @@ export default class LayoutConfig { return } } else { - throw "Unknown fixed layer " + layer; + console.log("Layer ", layer," not kown, try one of", Array.from(AllKnownLayers.sharedLayers.keys()).join(", ")) + throw `Unknown builtin layer ${layer} at ${context}.layers[${i}]`; } } @@ -195,9 +196,9 @@ export default class LayoutConfig { names = [names] } names.forEach(name => { - const shared = AllKnownLayers.sharedLayersJson[name]; + const shared = AllKnownLayers.sharedLayersJson.get(name); if (shared === undefined) { - throw "Unknown fixed layer " + name; + throw `Unknown shared/builtin layer ${name} at ${context}.layers[${i}]. Available layers are ${Array.from(AllKnownLayers.sharedLayersJson.keys()).join(", ")}`; } // @ts-ignore let newLayer: LayerConfigJson = Utils.Merge(layer.override, JSON.parse(JSON.stringify(shared))); // We make a deep copy of the shared layer, in order to protect it from changes diff --git a/assets/layers/surveillance_camera/surveillance_camera.json b/assets/layers/surveillance_camera/surveillance_camera.json index 77fed82af..7a6a4248c 100644 --- a/assets/layers/surveillance_camera/surveillance_camera.json +++ b/assets/layers/surveillance_camera/surveillance_camera.json @@ -422,19 +422,19 @@ } ], "icon": { - "render": "./assets/themes/surveillance_cameras/logo.svg", + "render": "./assets/themes/surveillance/logo.svg", "mappings": [ { "if": "camera:type=dome", - "then": "./assets/themes/surveillance_cameras/dome.svg" + "then": "./assets/themes/surveillance/dome.svg" }, { "if": "_direction:leftright=right", - "then": "./assets/themes/surveillance_cameras/cam_right.svg" + "then": "./assets/themes/surveillance/cam_right.svg" }, { "if": "_direction:leftright=left", - "then": "./assets/themes/surveillance_cameras/cam_left.svg" + "then": "./assets/themes/surveillance/cam_left.svg" } ] }, diff --git a/assets/themes/artwork/artwork.json b/assets/themes/artwork/artwork.json index 454ff9eac..feb957abc 100644 --- a/assets/themes/artwork/artwork.json +++ b/assets/themes/artwork/artwork.json @@ -429,4 +429,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/assets/themes/campersite/campersite.json b/assets/themes/campersite/campersite.json index 63192c55b..d458d8085 100644 --- a/assets/themes/campersite/campersite.json +++ b/assets/themes/campersite/campersite.json @@ -38,13 +38,13 @@ "nb_NO" ], "maintainer": "joost schouppe", - "icon": "./assets/themes/campersites/caravan.svg", + "icon": "./assets/themes/campersite/caravan.svg", "version": "0", "startLat": 43.14, "startLon": 3.14, "startZoom": 14, "widenFactor": 0.05, - "socialImage": "./assets/themes/campersites/Bar%C3%9Fel_Wohnmobilstellplatz.jpg", + "socialImage": "./assets/themes/campersite/Bar%C3%9Fel_Wohnmobilstellplatz.jpg", "layers": [ { "id": "caravansites", @@ -522,7 +522,7 @@ "reviews" ], "icon": { - "render": "circle:white;./assets/themes/campersites/caravan.svg", + "render": "circle:white;./assets/themes/campersite/caravan.svg", "mappings": [ { "if": { @@ -530,7 +530,7 @@ "fee=no" ] }, - "then": "circle:white;./assets/themes/campersites/caravan_green.svg" + "then": "circle:white;./assets/themes/campersite/caravan_green.svg" } ] }, @@ -862,7 +862,7 @@ } ], "icon": { - "render": "circle:white;./assets/themes/campersites/sanitary_dump_station.svg" + "render": "circle:white;./assets/themes/campersite/sanitary_dump_station.svg" }, "width": { "render": "8" diff --git a/assets/themes/cycle_infra/cycle_infra.json b/assets/themes/cycle_infra/cycle_infra.json index 6f1222ccf..5752938eb 100644 --- a/assets/themes/cycle_infra/cycle_infra.json +++ b/assets/themes/cycle_infra/cycle_infra.json @@ -976,7 +976,6 @@ ] } ], - "hideUnderlayingFeaturesMinPercentage": 0, "icon": { "render": "./assets/themes/cycle_infra/bicycleway.svg" }, diff --git a/assets/themes/cyclestreets/cyclestreets.json b/assets/themes/cyclestreets/cyclestreets.json index a09314b9d..a5a56c7cc 100644 --- a/assets/themes/cyclestreets/cyclestreets.json +++ b/assets/themes/cyclestreets/cyclestreets.json @@ -279,4 +279,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/assets/themes/fruit_trees/fruit_trees.json b/assets/themes/fruit_trees/fruit_trees.json index bf12bbeca..60d6e8a23 100644 --- a/assets/themes/fruit_trees/fruit_trees.json +++ b/assets/themes/fruit_trees/fruit_trees.json @@ -170,4 +170,4 @@ } ], "roamingRenderings": [] -} +} \ No newline at end of file diff --git a/assets/themes/surveillance/surveillance.json b/assets/themes/surveillance/surveillance.json index 62c17e76a..6090c3eee 100644 --- a/assets/themes/surveillance/surveillance.json +++ b/assets/themes/surveillance/surveillance.json @@ -25,7 +25,7 @@ "zh_Hant" ], "maintainer": "", - "icon": "./assets/themes/surveillance_cameras/logo.svg", + "icon": "./assets/themes/surveillance/logo.svg", "version": "0", "startLat": 0, "startLon": 0,