| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  | import {LayerDefinition} from "../LayerDefinition"; | 
					
						
							|  |  |  | import {And, Or, Tag} from "../../Logic/TagsFilter"; | 
					
						
							|  |  |  | import {OperatorTag} from "../Questions/OperatorTag"; | 
					
						
							|  |  |  | import * as L from "leaflet"; | 
					
						
							| 
									
										
										
										
											2020-07-14 20:18:44 +02:00
										 |  |  | import FixedText from "../Questions/FixedText"; | 
					
						
							| 
									
										
										
										
											2020-07-16 15:29:50 +02:00
										 |  |  | import { BikeParkingType } from "../Questions/bike/ParkingType"; | 
					
						
							| 
									
										
										
										
											2020-07-16 09:54:32 +02:00
										 |  |  | import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; | 
					
						
							| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | export class BikeParkings extends LayerDefinition { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     constructor() { | 
					
						
							|  |  |  |         super(); | 
					
						
							|  |  |  |         this.name = "bike_parking"; | 
					
						
							| 
									
										
										
										
											2020-07-13 17:16:12 +02:00
										 |  |  |         this.icon = "./assets/parking.svg"; | 
					
						
							|  |  |  |         this.overpassFilter = new Tag("amenity", "bicycle_parking"); | 
					
						
							| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  |         this.newElementTags = [ | 
					
						
							|  |  |  |             new Tag("amenity", "bicycle_parking"), | 
					
						
							|  |  |  |         ]; | 
					
						
							|  |  |  |         this.maxAllowedOverlapPercentage = 10; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         this.minzoom = 13; | 
					
						
							|  |  |  |         this.style = this.generateStyleFunction(); | 
					
						
							| 
									
										
										
										
											2020-07-16 09:54:32 +02:00
										 |  |  |         this.title = new FixedText("Fietsparking"); | 
					
						
							| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  |         this.elementsToShow = [ | 
					
						
							| 
									
										
										
										
											2020-07-16 09:54:32 +02:00
										 |  |  |             new ImageCarouselWithUploadConstructor(), | 
					
						
							| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  |             new OperatorTag(), | 
					
						
							|  |  |  |             new BikeParkingType() | 
					
						
							|  |  |  |         ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     private generateStyleFunction() { | 
					
						
							|  |  |  |         const self = this; | 
					
						
							|  |  |  |         return function (properties: any) { | 
					
						
							|  |  |  |             // let questionSeverity = 0;
 | 
					
						
							|  |  |  |             // for (const qd of self.elementsToShow) {
 | 
					
						
							|  |  |  |             //     if (qd.IsQuestioning(properties)) {
 | 
					
						
							|  |  |  |             //         questionSeverity = Math.max(questionSeverity, qd.options.priority ?? 0);
 | 
					
						
							|  |  |  |             //     }
 | 
					
						
							|  |  |  |             // }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             // let colormapping = {
 | 
					
						
							|  |  |  |             //     0: "#00bb00",
 | 
					
						
							|  |  |  |             //     1: "#00ff00",
 | 
					
						
							|  |  |  |             //     10: "#dddd00",
 | 
					
						
							|  |  |  |             //     20: "#ff0000"
 | 
					
						
							|  |  |  |             // };
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             // let colour = colormapping[questionSeverity];
 | 
					
						
							|  |  |  |             // while (colour == undefined) {
 | 
					
						
							|  |  |  |             //     questionSeverity--;
 | 
					
						
							|  |  |  |             //     colour = colormapping[questionSeverity];
 | 
					
						
							|  |  |  |             // }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             return { | 
					
						
							|  |  |  |                 color: "#00bb00", | 
					
						
							|  |  |  |                 icon: new L.icon({ | 
					
						
							|  |  |  |                     iconUrl: self.icon, | 
					
						
							| 
									
										
										
										
											2020-07-13 17:16:12 +02:00
										 |  |  |                     iconSize: [30, 30] | 
					
						
							| 
									
										
										
										
											2020-07-08 17:07:46 +02:00
										 |  |  |                 }) | 
					
						
							|  |  |  |             }; | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |