Add Open Toilet Map, fix #34

This commit is contained in:
Pieter Vander Vennet 2020-08-22 16:00:33 +02:00
parent 2df565dc50
commit a55767c1e9
11 changed files with 188 additions and 188 deletions

View file

@ -15,6 +15,7 @@ import {GhostBikes} from "./Layouts/GhostBikes";
import {CustomLayoutFromJSON} from "./JSON/CustomLayoutFromJSON";
import * as bookcases from "../assets/themes/bookcases/Bookcases.json";
import * as aed from "../assets/themes/aed/aed.json";
import * as toilets from "../assets/themes/toilets/toilets.json";
export class AllKnownLayouts {
@ -28,6 +29,7 @@ export class AllKnownLayouts {
new GhostBikes(),
CustomLayoutFromJSON.LayoutFromJSON(bookcases),
CustomLayoutFromJSON.LayoutFromJSON(aed),
CustomLayoutFromJSON.LayoutFromJSON(toilets),
new MetaMap(),
new StreetWidth(),

View file

@ -1,84 +0,0 @@
import {LayerDefinition} from "../LayerDefinition";
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
import L from "leaflet";
import {Tag} from "../../Logic/TagsFilter";
export class Toilets extends LayerDefinition{
constructor() {
super("toilets");
this.name="toilet";
this.newElementTags = [new Tag( "amenity", "toilets")];
this.icon = "./assets/toilets.svg";
this.overpassFilter = new Tag("amenity","toilets");
this.minzoom = 13;
this.questions = [Quests.hasFee,
Quests.toiletsWheelChairs,
Quests.toiletsChangingTable,
Quests.toiletsChangingTableLocation,
Quests.toiletsPosition];
this.style = function(tags){
if(tags.wheelchair == "yes"){
return {icon : new L.icon({
iconUrl: "assets/wheelchair.svg",
iconSize: [40, 40]
})};
}
return {icon : new L.icon({
iconUrl: "assets/toilets.svg",
iconSize: [40, 40]
})};
}
this.elementsToShow = [
new FixedUiElement("Toiletten"),
new TagMappingOptions({
key: "access",
mapping: {
yes: "Toegankelijk",
no: "Niet toegankelijk",
private: "Niet toegankelijk",
customers: "Enkel voor klanten",
}
}),
new TagMappingOptions({
key: "fee",
mapping: {
yes: "Betalend",
no: "Gratis",
["0"]: "Gratis"
},
template: "Betalend, men vraagt {fee}"
}),
new TagMappingOptions({
key: "toilets:position",
mapping: {
seated: 'Gewone zittoiletten',
urinal: 'Een enkele urinoir',
urinals: 'Urinoirs',
['urinals;seated']: "Urinoirs en gewone toiletten",
['seated;urinals']: "Urinoirs en gewone toiletten",
}
}),
new TagMappingOptions({
key: "wheelchair",
mapping: {
yes: "Rolstoeltoegankelijk",
no: "Niet Rolstoeltoegankelijk",
limited: "Beperkt rolstoeltoegankelijk",
}
}),
];
}
}

View file

@ -1,25 +0,0 @@
import {Layout} from "../Layout";
import * as Layer from "../Layers/Toilets";
export class Toilets extends Layout{
constructor() {
super( "toilets",
["en"],
"Open Toilet Map",
[new Layer.Toilets()],
12,
51.2,
3.2,
" <h3>Open Toilet Map</h3>\n" +
"\n" +
"<p>Help us to create the most complete map about <i>all</i> the toilets in the world, based on openStreetMap." +
"One can answer questions here, which help users all over the world to find an accessible toilet, close to them.</p>"
,
" <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");
}
}