forked from MapComplete/MapComplete
		
	Add ghost bikes, fix build
This commit is contained in:
		
							parent
							
								
									4ea179b76d
								
							
						
					
					
						commit
						431c90d9de
					
				
					 5 changed files with 31 additions and 52 deletions
				
			
		|  | @ -8,11 +8,11 @@ import {StreetWidth} from "./Layouts/StreetWidth"; | ||||||
| import {GRB} from "./Layouts/GRB"; | import {GRB} from "./Layouts/GRB"; | ||||||
| import {Artworks} from "./Layouts/Artworks"; | import {Artworks} from "./Layouts/Artworks"; | ||||||
| import {ClimbingTrees} from "./Layouts/ClimbingTrees"; | import {ClimbingTrees} from "./Layouts/ClimbingTrees"; | ||||||
| import {WalkByBrussels} from "./Layouts/WalkByBrussels"; |  | ||||||
| import {Smoothness} from "./Layouts/Smoothness"; | import {Smoothness} from "./Layouts/Smoothness"; | ||||||
| import {MetaMap} from "./Layouts/MetaMap"; | import {MetaMap} from "./Layouts/MetaMap"; | ||||||
| import {Natuurpunt} from "./Layouts/Natuurpunt"; | import {Natuurpunt} from "./Layouts/Natuurpunt"; | ||||||
| import {Bookcases} from "./Layouts/Bookcases"; | import {Bookcases} from "./Layouts/Bookcases"; | ||||||
|  | import {GhostBikes} from "./Layouts/GhostBikes"; | ||||||
| 
 | 
 | ||||||
| export class AllKnownLayouts { | export class AllKnownLayouts { | ||||||
| 
 | 
 | ||||||
|  | @ -23,8 +23,8 @@ export class AllKnownLayouts { | ||||||
|         new Groen(), |         new Groen(), | ||||||
|         new GRB(), |         new GRB(), | ||||||
|         new Cyclofix(), |         new Cyclofix(), | ||||||
|  |         new GhostBikes(), | ||||||
|         new Bookcases(), |         new Bookcases(), | ||||||
|         new WalkByBrussels(), |  | ||||||
|         new MetaMap(), |         new MetaMap(), | ||||||
|         new StreetWidth(), |         new StreetWidth(), | ||||||
|         new Natuurpunt(), |         new Natuurpunt(), | ||||||
|  |  | ||||||
|  | @ -1,20 +1,19 @@ | ||||||
| import {LayerDefinition} from "../LayerDefinition"; | import {LayerDefinition} from "../LayerDefinition"; | ||||||
| import {Tag} from "../../Logic/TagsFilter"; | import {Tag} from "../../Logic/TagsFilter"; | ||||||
| import {FixedUiElement} from "../../UI/Base/FixedUiElement"; |  | ||||||
| import FixedText from "../Questions/FixedText"; | import FixedText from "../Questions/FixedText"; | ||||||
| import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; | import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; | ||||||
| import L from "leaflet"; |  | ||||||
| import {TagRenderingOptions} from "../TagRenderingOptions"; | import {TagRenderingOptions} from "../TagRenderingOptions"; | ||||||
| 
 | 
 | ||||||
| export class GhostBike extends LayerDefinition { | export class GhostBike extends LayerDefinition { | ||||||
|     constructor() { |     constructor() { | ||||||
|         super("ghost bike"); |         super("ghost bike"); | ||||||
|         this.name = "ghost bike"; |         this.name = "Ghost bike"; | ||||||
|         this.overpassFilter = new Tag("memorial", "ghost_bike") |         this.overpassFilter = new Tag("memorial", "ghost_bike") | ||||||
|         this.title = new FixedText("Ghost bike"); |         this.title = new FixedText("Ghost bike"); | ||||||
|         this.description = "A <b>ghost bike</b> is a memorial for a cyclist who died in a traffic accident," + |         this.description = "A <b>ghost bike</b> is a memorial for a cyclist who died in a traffic accident," + | ||||||
|             " in the form of a white bicycle placed permanently near the accident location."; |             " in the form of a white bicycle placed permanently near the accident location."; | ||||||
| 
 | 
 | ||||||
|  |         this.minzoom = 1; | ||||||
| 
 | 
 | ||||||
|         this.presets = [ |         this.presets = [ | ||||||
|             { |             { | ||||||
|  | @ -67,11 +66,11 @@ export class GhostBike extends LayerDefinition { | ||||||
|         this.style =  (tags: any) => { |         this.style =  (tags: any) => { | ||||||
|             return { |             return { | ||||||
|                 color: "#000000", |                 color: "#000000", | ||||||
|                 icon: L.icon({ |                 icon: { | ||||||
|                     iconUrl: 'assets/bike/ghost.svg', |                     iconUrl: 'assets/bike/ghost.svg', | ||||||
|                     iconSize: [40, 40], |                     iconSize: [40, 40], | ||||||
|                     iconAnchor: [20, 20], |                     iconAnchor: [20, 20], | ||||||
|                 }) |                 } | ||||||
|             } |             } | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										23
									
								
								Customizations/Layouts/GhostBikes.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Customizations/Layouts/GhostBikes.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | ||||||
|  | import {Layout} from "../Layout"; | ||||||
|  | import {GhostBike} from "../Layers/GhostBike"; | ||||||
|  | import Combine from "../../UI/Base/Combine"; | ||||||
|  | import Translations from "../../UI/i18n/Translations"; | ||||||
|  | 
 | ||||||
|  | export class GhostBikes extends Layout { | ||||||
|  |     constructor() { | ||||||
|  |         super("ghostbikes", | ||||||
|  |             ["en"], | ||||||
|  |             "Ghost Bike Map", | ||||||
|  |             [new GhostBike()], | ||||||
|  |             6, | ||||||
|  |             50.423, | ||||||
|  |             5.493, | ||||||
|  |             new Combine(["<h3>", "A map of Ghost Bikes", "</h3>", | ||||||
|  |                 "A <b>ghost bike</b> is a memorial for a cyclist who died in a traffic accident," + | ||||||
|  |                 " in the form of a white bicycle placed permanently near the accident location.", | ||||||
|  |                 "On this map, one can see the location of known ghost bikes, and (with a free OpenStreetMap account) easily add missing and new Ghost Bikes"]) | ||||||
|  |         ); | ||||||
|  |          | ||||||
|  |         this.icon = "./assets/bike/ghost.svg"; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -1,29 +0,0 @@ | ||||||
| import { Layout } from "../Layout"; |  | ||||||
| import { DrinkingWater } from "../Layers/DrinkingWater"; |  | ||||||
| import { NatureReserves } from "../Layers/NatureReserves"; |  | ||||||
| import { Park } from "../Layers/Park"; |  | ||||||
| 
 |  | ||||||
| export class WalkByBrussels extends Layout { |  | ||||||
|     constructor() { |  | ||||||
|         super("walkbybrussels", |  | ||||||
|             ["en","fr","nl"], |  | ||||||
|             "Drinking Water Spots", |  | ||||||
|             [new DrinkingWater(), new Park(), new NatureReserves()], |  | ||||||
|             10, |  | ||||||
|             50.8435, |  | ||||||
|             4.3688, |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|             "        <h3>Drinking water</h3>\n" + |  | ||||||
|             "\n" + |  | ||||||
|             "<p>" + |  | ||||||
|             "Help with creating a map of drinking water points!" |  | ||||||
| 
 |  | ||||||
|             , |  | ||||||
|             "  <p>Start by <a href=\"https://www.openstreetmap.org/user/new\" target=\"_blank\">creating an account\n" + |  | ||||||
|             "            </a> or by " + |  | ||||||
|             "            <span onclick=\"authOsm()\" class=\"activate-osm-authentication\">logging in</span>.</p>", |  | ||||||
|             "Start by clicking a pin and answering the questions"); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -1,28 +1,14 @@ | ||||||
|  | 
 | ||||||
| import {UIElement} from "./UI/UIElement"; | import {UIElement} from "./UI/UIElement"; | ||||||
| UIElement.runningFromConsole = true; | UIElement.runningFromConsole = true; | ||||||
| 
 |  | ||||||
| import {AllKnownLayouts} from "./Customizations/AllKnownLayouts"; | import {AllKnownLayouts} from "./Customizations/AllKnownLayouts"; | ||||||
| import {Layout} from "./Customizations/Layout"; | import {Layout} from "./Customizations/Layout"; | ||||||
| import {readFileSync, writeFile, writeFileSync} from "fs"; | import {readFileSync, writeFile, writeFileSync} from "fs"; | ||||||
|  | import Locale from "./UI/i18n/Locale"; | ||||||
| import svg2img from 'promise-svg2img'; | import svg2img from 'promise-svg2img'; | ||||||
| import Translation from "./UI/i18n/Translation"; | import Translation from "./UI/i18n/Translation"; | ||||||
| import Locale from "./UI/i18n/Locale"; |  | ||||||
| import Translations from "./UI/i18n/Translations"; | import Translations from "./UI/i18n/Translations"; | ||||||
| 
 | 
 | ||||||
| import {All} from "./Customizations/Layouts/All"; |  | ||||||
| import {StreetWidth} from "./Customizations/Layouts/StreetWidth"; |  | ||||||
| import {LayerDefinition}  from"./Customizations/LayerDefinition"; |  | ||||||
| import {ClimbingTrees} from "./Customizations/Layouts/ClimbingTrees"; |  | ||||||
| import {Smoothness} from "./Customizations/Layouts/Smoothness"; |  | ||||||
| import {Natuurpunt} from "./Customizations/Layouts/Natuurpunt"; |  | ||||||
| import {Groen} from "./Customizations/Layouts/Groen"; |  | ||||||
| import Cyclofix from "./Customizations/Layouts/Cyclofix"; |  | ||||||
| import {CustomLayout} from "./Logic/CustomLayers"; |  | ||||||
| import {GRB} from "./Customizations/Layouts/GRB"; |  | ||||||
| import {Artworks} from "./Customizations/Layouts/Artworks"; |  | ||||||
| import {WalkByBrussels} from "./Customizations/Layouts/WalkByBrussels"; |  | ||||||
| import {MetaMap} from "./Customizations/Layouts/MetaMap"; |  | ||||||
| import {Bookcases} from "./Customizations/Layouts/Bookcases"; |  | ||||||
| 
 | 
 | ||||||
| console.log("Building the layouts") | console.log("Building the layouts") | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue