forked from MapComplete/MapComplete
		
	Console logging
This commit is contained in:
		
							parent
							
								
									6118d734c0
								
							
						
					
					
						commit
						4f3135caef
					
				
					 6 changed files with 10 additions and 16 deletions
				
			
		|  | @ -447,7 +447,6 @@ export class InitUiElements { | ||||||
|         const queryParam = QueryParameters.GetQueryParameter("background", State.state.layoutToUse.data.defaultBackground); |         const queryParam = QueryParameters.GetQueryParameter("background", State.state.layoutToUse.data.defaultBackground); | ||||||
| 
 | 
 | ||||||
|         queryParam.addCallbackAndRun((selectedId:string) => { |         queryParam.addCallbackAndRun((selectedId:string) => { | ||||||
|             console.log("Selected layer is ", selectedId) |  | ||||||
|             const available = State.state.availableBackgroundLayers.data; |             const available = State.state.availableBackgroundLayers.data; | ||||||
|             for (const layer of available) { |             for (const layer of available) { | ||||||
|                 if (layer.id === selectedId) { |                 if (layer.id === selectedId) { | ||||||
|  |  | ||||||
|  | @ -125,14 +125,18 @@ export default class MetaTagging { | ||||||
| 
 | 
 | ||||||
|     public static carriageWayWidth = new SimpleMetaTagger( |     public static carriageWayWidth = new SimpleMetaTagger( | ||||||
|         ["_width:needed","_width:needed:no_pedestrians", "_width:difference"], |         ["_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) => { |         (feature: any, index: number) => { | ||||||
| 
 | 
 | ||||||
|  |             const properties = feature.properties; | ||||||
|  |             if(properties["width:carriageway"] === undefined){ | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |              | ||||||
|             const carWidth = 2; |             const carWidth = 2; | ||||||
|             const cyclistWidth = 1.5; |             const cyclistWidth = 1.5; | ||||||
|             const pedestrianWidth = 0.75; |             const pedestrianWidth = 0.75; | ||||||
| 
 | 
 | ||||||
|             const properties = feature.properties; |  | ||||||
| 
 | 
 | ||||||
|             const _leftSideParking = |             const _leftSideParking = | ||||||
|                 new And([new Tag("parking:lane:left", "parallel"), new Tag("parking:lane:right", "no_parking")]); |                 new And([new Tag("parking:lane:left", "parallel"), new Tag("parking:lane:right", "no_parking")]); | ||||||
|  |  | ||||||
|  | @ -35,8 +35,4 @@ export class ImageCarousel extends UIElement{ | ||||||
|     InnerRender(): string { |     InnerRender(): string { | ||||||
|         return this.slideshow.Render(); |         return this.slideshow.Render(); | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
|     IsKnown(): boolean { |  | ||||||
|         return true; |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|  | @ -51,8 +51,6 @@ export class SimpleAddUI extends UIElement { | ||||||
| 
 | 
 | ||||||
|             const presets = layer.layerDef.presets; |             const presets = layer.layerDef.presets; | ||||||
|             for (const preset of presets) { |             for (const preset of presets) { | ||||||
|                 console.log("Preset:", preset) |  | ||||||
| 
 |  | ||||||
|                 let icon: string = layer.layerDef.icon.GetRenderValue( |                 let icon: string = layer.layerDef.icon.GetRenderValue( | ||||||
|                     TagUtils.KVtoProperties(preset.tags ?? [])).txt ?? |                     TagUtils.KVtoProperties(preset.tags ?? [])).txt ?? | ||||||
|                     "./assets/bug.svg"; |                     "./assets/bug.svg"; | ||||||
|  |  | ||||||
|  | @ -22,18 +22,18 @@ export class SubstitutedTranslation extends UIElement { | ||||||
|         this.translation = translation; |         this.translation = translation; | ||||||
|         this.tags = tags; |         this.tags = tags; | ||||||
|         const self = this; |         const self = this; | ||||||
|  |         this.dumbMode = false; | ||||||
|         Locale.language.addCallbackAndRun(() => { |         Locale.language.addCallbackAndRun(() => { | ||||||
|             self.content = self.CreateContent(); |             self.content = self.CreateContent(); | ||||||
|             self.Update(); |             self.Update(); | ||||||
|         }); |         }); | ||||||
|         this.dumbMode = false; |          | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     InnerRender(): string { |     InnerRender(): string { | ||||||
|         return new Combine(this.content).Render(); |         return new Combine(this.content).Render(); | ||||||
|     } |     } | ||||||
|      |      | ||||||
| 
 |  | ||||||
|     private CreateContent(): UIElement[] { |     private CreateContent(): UIElement[] { | ||||||
|         let txt = this.translation?.txt; |         let txt = this.translation?.txt; | ||||||
|         if (txt === undefined) { |         if (txt === undefined) { | ||||||
|  |  | ||||||
|  | @ -10,9 +10,6 @@ import svg2img from 'promise-svg2img'; | ||||||
| import {Translation} from "./UI/i18n/Translations"; | import {Translation} from "./UI/i18n/Translations"; | ||||||
| import Translations from "./UI/i18n/Translations"; | import Translations from "./UI/i18n/Translations"; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| console.log("Building the layouts") |  | ||||||
| 
 |  | ||||||
| function enc(str: string): string { | function enc(str: string): string { | ||||||
|     return encodeURIComponent(str.toLowerCase()); |     return encodeURIComponent(str.toLowerCase()); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue