From e3f2c56d3ed055255d32930d554c72bdf3cc5369 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sat, 3 Jul 2021 22:00:36 +0200 Subject: [PATCH] Fix taginfo script, formatting, docs regeneration --- Customizations/AllKnownLayers.ts | 6 +++--- Customizations/AllKnownLayouts.ts | 3 +-- Customizations/SharedTagRenderings.ts | 4 ---- Docs/SpecialRenderings.md | 2 +- scripts/generateTaginfoProjectFiles.ts | 5 +++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Customizations/AllKnownLayers.ts b/Customizations/AllKnownLayers.ts index 2e5ba33915..97e195db14 100644 --- a/Customizations/AllKnownLayers.ts +++ b/Customizations/AllKnownLayers.ts @@ -8,14 +8,14 @@ export default class AllKnownLayers { // Must be below the list... public static sharedLayers: Map = AllKnownLayers.getSharedLayers(); public static sharedLayersJson: Map = AllKnownLayers.getSharedLayersJson(); - + public static sharedUnits: any[] = [] private static getSharedLayers(): Map { const sharedLayers = new Map(); for (const layer of known_layers.layers) { try { - const parsed = new LayerConfig(layer, AllKnownLayers.sharedUnits,"shared_layers") + const parsed = new LayerConfig(layer, AllKnownLayers.sharedUnits, "shared_layers") sharedLayers.set(layer.id, parsed); sharedLayers[layer.id] = parsed; } catch (e) { @@ -35,7 +35,7 @@ export default class AllKnownLayers { continue; } try { - const parsed = new LayerConfig(layer, AllKnownLayers.sharedUnits ,"shared_layer_in_theme") + const parsed = new LayerConfig(layer, AllKnownLayers.sharedUnits, "shared_layer_in_theme") sharedLayers.set(layer.id, parsed); sharedLayers[layer.id] = parsed; } catch (e) { diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 65c76e2ded..54363cc25e 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -1,8 +1,7 @@ import LayoutConfig from "./JSON/LayoutConfig"; import AllKnownLayers from "./AllKnownLayers"; import * as known_themes from "../assets/generated/known_layers_and_themes.json" -import {LayoutConfigJson} from "./JSON/LayoutConfigJson"; -import * as all_layouts from "../assets/generated/known_layers_and_themes.json" + export class AllKnownLayouts { diff --git a/Customizations/SharedTagRenderings.ts b/Customizations/SharedTagRenderings.ts index a75a65d90b..b3af01c83d 100644 --- a/Customizations/SharedTagRenderings.ts +++ b/Customizations/SharedTagRenderings.ts @@ -1,7 +1,6 @@ import TagRenderingConfig from "./JSON/TagRenderingConfig"; import * as questions from "../assets/tagRenderings/questions.json"; import * as icons from "../assets/tagRenderings/icons.json"; -import {Utils} from "../Utils"; export default class SharedTagRenderings { @@ -12,9 +11,6 @@ export default class SharedTagRenderings { const dict = new Map(); function add(key, store) { - if(Utils.runningFromConsole){ - return; - } try { dict.set(key, new TagRenderingConfig(store[key], undefined, `SharedTagRenderings.${key}`)) } catch (e) { diff --git a/Docs/SpecialRenderings.md b/Docs/SpecialRenderings.md index 928c670ff0..524b591223 100644 --- a/Docs/SpecialRenderings.md +++ b/Docs/SpecialRenderings.md @@ -42,7 +42,7 @@ image-key | image | Image tag to add the URL to (or image-tag:0, image-tag:1 whe name | default | description ------ | --------- | ------------- -zoomlevel | 18 | The zoomlevel: the higher, the more zoomed in with 1 being the entire world and 19 being really close +zoomlevel | 18 | The (maximum) zoomlevel: the target zoomlevel after fitting the entire feature. The minimap will fit the entire feature, then zoom out to this zoom level. The higher, the more zoomed in with 1 being the entire world and 19 being really close idKey | id | (Matches all resting arguments) This argument should be the key of a property of the feature. The corresponding value is interpreted as either the id or the a list of ID's. The features with these ID's will be shown on this minimap. #### Example usage diff --git a/scripts/generateTaginfoProjectFiles.ts b/scripts/generateTaginfoProjectFiles.ts index 3059957ca2..9e4ff2c541 100644 --- a/scripts/generateTaginfoProjectFiles.ts +++ b/scripts/generateTaginfoProjectFiles.ts @@ -47,8 +47,9 @@ function generateLayerUsage(layer: LayerConfig, layout: LayoutConfig): any [] { for (const tr of layer.tagRenderings) { { - const usesImageCarousel = (tr.render?.txt?.indexOf("image_carousel()") ?? -2) > 0 - const usesImageUpload = (tr.render?.txt?.indexOf("image_upload()") ?? -2) > 0 + const usesImageCarousel = (tr.render?.txt?.indexOf("image_carousel") ?? -2) > 0 + const usesImageUpload = (tr.render?.txt?.indexOf("image_upload") ?? -2) > 0 + if (usesImageCarousel || usesImageUpload) { const descrNoUpload = `The layer '${layer.name.txt} shows images based on the keys image, image:0, image:1,... and wikidata, wikipedia, wikimedia_commons and mapillary`;