| 
									
										
										
										
											2020-07-16 22:00:23 +02:00
										 |  |  | import {LayerDefinition} from "../LayerDefinition"; | 
					
						
							|  |  |  | import {And, Or, Tag} from "../../Logic/TagsFilter"; | 
					
						
							|  |  |  | import {OperatorTag} from "../Questions/OperatorTag"; | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  | import * as L from "leaflet"; | 
					
						
							|  |  |  | import FixedText from "../Questions/FixedText"; | 
					
						
							| 
									
										
										
										
											2020-07-16 22:00:23 +02:00
										 |  |  | import {TagRenderingOptions} from "../TagRendering"; | 
					
						
							|  |  |  | import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; | 
					
						
							| 
									
										
										
										
											2020-07-22 17:59:38 +02:00
										 |  |  | import Translations from "../../UI/i18n/Translations"; | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-17 17:21:07 +02:00
										 |  |  | export class DrinkingWater extends LayerDefinition { | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     constructor() { | 
					
						
							|  |  |  |         super(); | 
					
						
							| 
									
										
										
										
											2020-07-22 17:59:38 +02:00
										 |  |  |         this.name = Translations.t.cyclofix.drinking_water.title; | 
					
						
							| 
									
										
										
										
											2020-07-20 16:16:22 +02:00
										 |  |  |         this.icon = "./assets/bike/drinking_water.svg"; | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         this.overpassFilter = new Or([ | 
					
						
							|  |  |  |             new And([ | 
					
						
							|  |  |  |                 new Tag("amenity", "drinking_water") | 
					
						
							|  |  |  |             ]) | 
					
						
							|  |  |  |         ]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-29 18:35:46 +02:00
										 |  |  |         this.presets = [{ | 
					
						
							|  |  |  |             title: Translations.t.cyclofix.drinking_water.title, | 
					
						
							|  |  |  |             icon: "/assets/bike/drinking_water.svg", | 
					
						
							|  |  |  |             tags: [new Tag("amenity", "drinking_water")] | 
					
						
							|  |  |  |         }]; | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  |         this.maxAllowedOverlapPercentage = 10; | 
					
						
							| 
									
										
										
										
											2020-07-22 00:50:30 +02:00
										 |  |  |         this.wayHandling = LayerDefinition.WAYHANDLING_CENTER_AND_WAY | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         this.minzoom = 13; | 
					
						
							|  |  |  |         this.style = this.generateStyleFunction(); | 
					
						
							|  |  |  |         this.title = new FixedText("Drinking water"); | 
					
						
							|  |  |  |         this.elementsToShow = [ | 
					
						
							|  |  |  |             new OperatorTag(), | 
					
						
							|  |  |  |         ]; | 
					
						
							| 
									
										
										
										
											2020-07-17 17:21:07 +02:00
										 |  |  |         this.elementsToShow = [ | 
					
						
							|  |  |  |             new ImageCarouselWithUploadConstructor(), | 
					
						
							|  |  |  |             new TagRenderingOptions({ | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  |             question: "How easy is it to fill water bottles?", | 
					
						
							|  |  |  |             mappings: [ | 
					
						
							|  |  |  |                 { k: new Tag("bottle", "yes"), txt: "It is easy to refill water bottles" }, | 
					
						
							|  |  |  |                 { k: new Tag("bottle", "no"), txt: "Water bottles may not fit" } | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |         })]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     private generateStyleFunction() { | 
					
						
							|  |  |  |         const self = this; | 
					
						
							|  |  |  |         return function (properties: any) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             return { | 
					
						
							|  |  |  |                 color: "#00bb00", | 
					
						
							| 
									
										
										
										
											2020-07-26 02:01:34 +02:00
										 |  |  |                 icon: { | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  |                     iconUrl: self.icon, | 
					
						
							| 
									
										
										
										
											2020-07-20 16:16:22 +02:00
										 |  |  |                     iconSize: [50, 50], | 
					
						
							|  |  |  |                     iconAnchor: [25,50] | 
					
						
							| 
									
										
										
										
											2020-07-26 02:01:34 +02:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2020-07-15 14:03:44 +02:00
										 |  |  |             }; | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |