Add bicycle libraries

This commit is contained in:
pietervdvn 2021-01-05 02:59:29 +01:00
parent 85a6894c92
commit a782266a2f
7 changed files with 361 additions and 107 deletions

View file

@ -11,6 +11,8 @@ import * as bike_monitoring_station from "../assets/layers/bike_monitoring_stati
import * as cycling_themed_objects from "../assets/layers/cycling_themed_object/cycling_themed_objects.json"
import * as bike_shops from "../assets/layers/bike_shop/bike_shop.json"
import * as bike_cleaning from "../assets/layers/bike_cleaning/bike_cleaning.json"
import * as bicycle_library from "../assets/layers/bicycle_library/bicycle_library.json"
import * as maps from "../assets/layers/maps/maps.json"
import * as information_boards from "../assets/layers/information_board/information_board.json"
import * as direction from "../assets/layers/direction/direction.json"
@ -38,6 +40,7 @@ export default class SharedLayers {
new LayerConfig(birdhides,[], "shared_layers"),
new LayerConfig(nature_reserve,[], "shared_layers"),
new LayerConfig(bike_cafes,[], "shared_layers"),
new LayerConfig(bicycle_library, [], "bike_library"),
new LayerConfig(cycling_themed_objects,[], "shared_layers"),
new LayerConfig(bike_shops,[], "shared_layers"),
new LayerConfig(bike_cleaning,[], "shared_layers"),

View file

@ -116,6 +116,9 @@ export default class ShowDataLayer {
const tags = State.state.allElements.getEventSourceFor(feature);
const uiElement: LazyElement = new LazyElement(() => new FeatureInfoBox(tags, layer));
popup.setContent(uiElement.Render());
popup.on('popupclose', () => {
State.state.selectedElement.setData(undefined);
});
leafletLayer.bindPopup(popup);
// We first render the UIelement (which'll still need an update later on...)
// But at least it'll be visible already

View file

@ -0,0 +1,163 @@
{
"id": "bicycle_library",
"name": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek"
},
"minzoom": 8 ,
"overpassTags": "amenity=bicycle_library",
"title": {
"render": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek"
},
"mappings": [
{
"if": "name~*",
"then": "<i>{name}</i>"
}
]
},
"titleIcons": [
{
"condition": {
"or": [
"service:bicycle:pump=yes",
"service:bicycle:pump=separate"
]
},
"render": "<img src='./assets/layers/bike_shop/pump.svg'/>"
},
"defaults"
],
"description": {
"en": "A facility where bicycles can be lent for longer period of times",
"nl": "Een plaats waar men voor langere tijd een fiets kan lenen"
},
"tagRenderings": [
"images",
{
"question": {
"en": "What is the name of this bicycle library?",
"nl": "Wat is de naam van deze fietsbieb?"
},
"render": {
"en": "This bicycle library shop is called {name}",
"nl": "Deze fietsbieb heet {name}"
},
"freeform": {
"key": "name"
}
},
"website",
"phone",
"email",
"opening_hours",
{
"question": {
"en": "How much does lending a bicycle cost?",
"nl": "Hoeveel kost het huren van een fiets?"
},
"render":{
"en": "Lending a bicycle costs {charge}",
"nl": "Een fiets huren kost {charge{"
},
"freeform": {
"key": "charge",
"extraTags": ["fee=yes"]
},
"mappings": [
{
"if": {
"and": ["fee=no","charge="]
},
"then": {
"en": "Lending a bicycle is free",
"nl": "Een fiets huren is gratis"
}
},
{
"if": {
"and": ["fee=yes","charge=€20warranty + €20/year"]
},
"then": {
"en": "Lending a bicycle costs €20/year and €20 warranty",
"nl": "Een fiets huren kost €20/jaar en €20 waarborg"
}
}
]
},
{
"question": {
"en": "Who can lend bicycles here?",
"nl": "Voor wie worden hier fietsen aangeboden?"
},
"multiAnswer": true,
"mappings": [
{
"if": "bicycle_library:for=child",
"then": {
"nl": "Aanbod voor kinderen",
"en": "Bikes for children available"
}
},
{
"if": "bicycle_library:for=adult",
"then": {
"nl": "Aanbod voor volwassenen",
"en": "Bikes for adult available"
}
},
{
"if": "bicycle_library:for=disabled",
"then": {
"nl": "Aanbod voor personen met een handicap",
"en": "Bikes for disabled persons available"
}
}
]
},
"description"
],
"hideUnderlayingFeaturesMinPercentage": 1,
"presets": [
{
"title": {
"en": "Fietsbibliotheek",
"nl": "Bicycle library"
},
"tags": [
"amenity=bicycle_library"
],
"description": {
"nl": "Een fietsbieb heeft een collectie fietsen die leden mogen lenen",
"en": "A bicycle library has a collection of bikes which can be lent"
}
}
],
"icon": {
"render": "pin:#22ff55;./assets/layers/bicycle_library/bicycle_library.svg"
},
"iconOverlays": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
},
{
"if": "service:bicycle:pump=yes",
"then": "circle:#e2783d;./assets/layers/bike_repair_station/pump.svg",
"badge": true
}
],
"width": {
"render": "1"
},
"iconSize": {
"render": "50,50,bottom"
},
"color": {
"render": "#c00"
},
"wayHandling": 2
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,105 +0,0 @@
{
"id": "bike_libraries",
"name": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek",
},
"minzoom": 13,
"overpassTags": "amenity=bicycle_library",
"title": {
"render": {
"en": "Bicycle library",
"nl": "Fietsbibliotheek"
},
"mappings": [
{
"if": "name~*",
"then": "<i>{name}</i>"
}
]
},
"titleIcons": [
{
"condition": {
"or": [
"service:bicycle:pump=yes",
"service:bicycle:pump=separate"
]
},
"render": "<img src='./assets/layers/bike_shop/pump.svg'/>"
},
"defaults"
],
"description": {
"en": "A facility where bicycles can be lent for longer period of times",
"nl": "Een plaats waar men voor langere tijd een fiets kan lenen"
},
"tagRenderings": [
"images",
{
"question": {
"en": "What is the name of this bicycle library?",
"nl": "Wat is de naam van deze fietsbieb?",
},
"render": {
"en": "This bicycle library shop is called {name}",
"nl": "Deze fietsbieb heet {name}",
},
"freeform": {
"key": "name"
}
},
"website",
"phone",
"email",
"opening_hours",
"description",
],
"hideUnderlayingFeaturesMinPercentage": 1,
"presets": [
{
"title": {
"en": "Fietsbibliotheek",
"nl": "Bicycle library",
},
"tags": [
"shop=bicycle"
]
}
],
"icon": {
"render": "./assets/layers/bike_shop/repair_shop.svg",
"mappings": [
{
"if": "operator=De Fietsambassade Gent",
"then": "./assets/themes/cyclofix/fietsambassade_gent_logo_small.svg"
},
{
"if": "service:bicycle:retail=yes",
"then": "./assets/layers/bike_shop/shop.svg"
}
]
},
"iconOverlays": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
},
{
"if": "service:bicycle:pump=yes",
"then": "circle:#e2783d;./assets/layers/bike_repair_station/pump.svg",
"badge": true
}
],
"width": {
"render": "1"
},
"iconSize": {
"render": "50,50,bottom"
},
"color": {
"render": "#c00"
},
"wayHandling": 2
}

View file

@ -71,6 +71,20 @@
"freeform": {
"key": "opening_hours",
"type": "opening_hours"
}
},
"mappings": [
{
"if": {
"or": ["opening_hours=by appointment",
"opening_hours=by_appointment",
"opening_hours=\"by appointment\""]
},
"then": {
"en": "Only by appointment",
"nl": "Enkel op afspraak"
},
"hideInAnswers": true
}
]
}
}

View file

@ -25,6 +25,6 @@
"startZoom": 16,
"widenFactor": 0.05,
"socialImage": "./assets/themes/cyclofix/logo.svg",
"layers": ["bike_cafes", "bike_shops", "bike_repair_station", "drinking_water", "bike_themed_object","bike_cleaning","bike_parking"],
"layers": ["bike_cafes", "bike_shops", "bicycle_library","bike_repair_station", "drinking_water", "bike_themed_object","bike_cleaning","bike_parking"],
"roamingRenderings": []
}