From 4f3135caefcb8b812c07f1283168b34b90696a90 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Nov 2020 12:38:04 +0100 Subject: [PATCH] Console logging --- InitUiElements.ts | 1 - Logic/MetaTagging.ts | 8 ++++++-- UI/Image/ImageCarousel.ts | 6 +----- UI/SimpleAddUI.ts | 2 -- UI/SpecialVisualizations.ts | 6 +++--- createLayouts.ts | 3 --- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/InitUiElements.ts b/InitUiElements.ts index 9e97780b7..206bf16c4 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -447,7 +447,6 @@ export class InitUiElements { const queryParam = QueryParameters.GetQueryParameter("background", State.state.layoutToUse.data.defaultBackground); queryParam.addCallbackAndRun((selectedId:string) => { - console.log("Selected layer is ", selectedId) const available = State.state.availableBackgroundLayers.data; for (const layer of available) { if (layer.id === selectedId) { diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index 23a5c4381..3aa3280b9 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -125,14 +125,18 @@ export default class MetaTagging { public static carriageWayWidth = new SimpleMetaTagger( ["_width:needed","_width:needed:no_pedestrians", "_width:difference"], - "Legacy for a specific project calculating the needed width for safe traffic on a road", + "Legacy for a specific project calculating the needed width for safe traffic on a road. Only activated if 'width:carriageway' is present", (feature: any, index: number) => { + const properties = feature.properties; + if(properties["width:carriageway"] === undefined){ + return; + } + const carWidth = 2; const cyclistWidth = 1.5; const pedestrianWidth = 0.75; - const properties = feature.properties; const _leftSideParking = new And([new Tag("parking:lane:left", "parallel"), new Tag("parking:lane:right", "no_parking")]); diff --git a/UI/Image/ImageCarousel.ts b/UI/Image/ImageCarousel.ts index b6d0c1d3a..b7f96c5a4 100644 --- a/UI/Image/ImageCarousel.ts +++ b/UI/Image/ImageCarousel.ts @@ -31,12 +31,8 @@ export class ImageCarousel extends UIElement{ this.slideshow = new SlideShow(uiElements).HideOnEmpty(true); } - + InnerRender(): string { return this.slideshow.Render(); } - - IsKnown(): boolean { - return true; - } } \ No newline at end of file diff --git a/UI/SimpleAddUI.ts b/UI/SimpleAddUI.ts index b9cb42f15..6984b4f5a 100644 --- a/UI/SimpleAddUI.ts +++ b/UI/SimpleAddUI.ts @@ -51,8 +51,6 @@ export class SimpleAddUI extends UIElement { const presets = layer.layerDef.presets; for (const preset of presets) { - console.log("Preset:", preset) - let icon: string = layer.layerDef.icon.GetRenderValue( TagUtils.KVtoProperties(preset.tags ?? [])).txt ?? "./assets/bug.svg"; diff --git a/UI/SpecialVisualizations.ts b/UI/SpecialVisualizations.ts index 4ff6f431a..32e70cb22 100644 --- a/UI/SpecialVisualizations.ts +++ b/UI/SpecialVisualizations.ts @@ -22,18 +22,18 @@ export class SubstitutedTranslation extends UIElement { this.translation = translation; this.tags = tags; const self = this; + this.dumbMode = false; Locale.language.addCallbackAndRun(() => { self.content = self.CreateContent(); self.Update(); }); - this.dumbMode = false; + } InnerRender(): string { return new Combine(this.content).Render(); } - - + private CreateContent(): UIElement[] { let txt = this.translation?.txt; if (txt === undefined) { diff --git a/createLayouts.ts b/createLayouts.ts index c5ea48246..f933e9070 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -10,9 +10,6 @@ import svg2img from 'promise-svg2img'; import {Translation} from "./UI/i18n/Translations"; import Translations from "./UI/i18n/Translations"; - -console.log("Building the layouts") - function enc(str: string): string { return encodeURIComponent(str.toLowerCase()); }