2020-07-07 16:00:27 +02:00
|
|
|
import {LayerDefinition} from "../LayerDefinition";
|
|
|
|
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
|
|
|
import * as L from "leaflet";
|
2020-07-14 20:18:44 +02:00
|
|
|
import FixedText from "../Questions/FixedText";
|
|
|
|
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
|
2020-07-16 09:25:20 +02:00
|
|
|
import {TagRenderingOptions} from "../TagRendering";
|
2020-07-07 16:00:27 +02:00
|
|
|
|
|
|
|
export class BikePumps extends LayerDefinition {
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.name = "pomp";
|
|
|
|
this.icon = "./assets/bike_pump.svg";
|
|
|
|
|
2020-07-15 10:47:01 +02:00
|
|
|
this.overpassFilter =
|
2020-07-16 09:25:20 +02:00
|
|
|
new Or([
|
|
|
|
new And([
|
|
|
|
new Tag("amenity", "compressed_air"),
|
|
|
|
new Tag("bicycle", "yes")
|
|
|
|
]),
|
|
|
|
new And([
|
|
|
|
new Tag("amenity", "bicycle_repair_station"),
|
|
|
|
new Tag("service:bicycle:pump", "yes"),
|
|
|
|
/* new Or([
|
|
|
|
new Tag("service:bicycle:tools", ""),
|
|
|
|
new Tag("service:bicycle:tools", "no"),
|
|
|
|
])*/
|
|
|
|
]),
|
2020-07-15 10:47:01 +02:00
|
|
|
]);
|
2020-07-07 16:00:27 +02:00
|
|
|
|
|
|
|
this.newElementTags = [
|
2020-07-14 20:18:44 +02:00
|
|
|
new Tag("amenity", "bicycle_repair_station"),
|
|
|
|
new Tag("service:bicycle:pump", "yes"),
|
2020-07-07 16:00:27 +02:00
|
|
|
];
|
2020-07-15 10:47:01 +02:00
|
|
|
|
2020-07-07 16:00:27 +02:00
|
|
|
this.maxAllowedOverlapPercentage = 10;
|
|
|
|
|
|
|
|
this.minzoom = 13;
|
2020-07-15 10:47:01 +02:00
|
|
|
const self = this;
|
|
|
|
this.style = (properties: any) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
color: "#00bb00",
|
|
|
|
icon: new L.icon({
|
|
|
|
iconUrl: self.icon,
|
|
|
|
iconSize: [40, 40]
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-07-14 20:18:44 +02:00
|
|
|
this.title = new FixedText("Pomp");
|
2020-07-07 16:00:27 +02:00
|
|
|
this.elementsToShow = [
|
2020-07-14 20:18:44 +02:00
|
|
|
new ImageCarouselWithUploadConstructor(),
|
2020-07-16 09:25:20 +02:00
|
|
|
|
|
|
|
new TagRenderingOptions({
|
|
|
|
question: "What valves are supported?",
|
|
|
|
mappings: [
|
|
|
|
{
|
|
|
|
k: new Tag("valves", " sclaverand;schrader;dunlop"),
|
|
|
|
txt: "There is a default head, so Presta, Dunlop and Auto"
|
|
|
|
},
|
|
|
|
{k: new Tag("valves", "dunlop"), txt: "Only dunlop"},
|
|
|
|
{k: new Tag("valves", "sclaverand"), txt: "Only Sclaverand (also known as Dunlop)"},
|
|
|
|
{k: new Tag("valves", "auto"), txt: "Only auto"},
|
|
|
|
],
|
|
|
|
freeform: {
|
|
|
|
key: "valves",
|
|
|
|
template: "Supported valves are $$$",
|
|
|
|
renderTemplate: "Supported valves are {valves}"
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
|
|
|
|
new TagRenderingOptions({
|
|
|
|
question: "Who maintains this bicycle pump?",
|
|
|
|
freeform: {
|
|
|
|
key: "operator",
|
|
|
|
template: "Maintained by $$$",
|
|
|
|
renderTemplate: "Maintained by {operator}",
|
|
|
|
placeholder: "operator"
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
|
|
|
|
new TagRenderingOptions({
|
|
|
|
question: "Does the pump have a pressure indicator or manometer?",
|
|
|
|
mappings: [
|
|
|
|
{k: new Tag("manometer", "yes"), txt: "Yes, there is a manometer"},
|
|
|
|
{k: new Tag("manometer", "yes"), txt: "No"}
|
|
|
|
]
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
/* new TagRenderingOptions({
|
|
|
|
question: "Is dit een manuele pomp?",
|
|
|
|
mappings: [
|
|
|
|
{k: new Tag("manual", "yes"), txt: "Manuele pomp"},
|
|
|
|
{k: new Tag("manual", "no"), txt: "Automatische pomp"}
|
|
|
|
]
|
|
|
|
}) */
|
2020-07-07 16:00:27 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|