Merge branch 'bike-pumps'

This commit is contained in:
Pieter Vander Vennet 2020-07-09 15:29:02 +02:00
commit 07b579c6fb
6 changed files with 112 additions and 10 deletions

View file

@ -3,8 +3,7 @@ import {Toilets} from "./Layouts/Toilets";
import {GRB} from "./Layouts/GRB"; import {GRB} from "./Layouts/GRB";
import {Statues} from "./Layouts/Statues"; import {Statues} from "./Layouts/Statues";
import {Bookcases} from "./Layouts/Bookcases"; import {Bookcases} from "./Layouts/Bookcases";
import { BikePumps } from "./Layers/BikePumps"; import Cyclofix from "./Layouts/Cyclofix";
import { BikePumpsLayout } from "./Layouts/BikePumps";
export class AllKnownLayouts { export class AllKnownLayouts {
public static allSets: any = AllKnownLayouts.AllLayouts(); public static allSets: any = AllKnownLayouts.AllLayouts();
@ -13,7 +12,7 @@ export class AllKnownLayouts {
const layouts = [ const layouts = [
new Groen(), new Groen(),
new GRB(), new GRB(),
new BikePumpsLayout(), new Cyclofix(),
new Bookcases() new Bookcases()
/*new Toilets(), /*new Toilets(),
new Statues(), new Statues(),

View file

@ -0,0 +1,71 @@
import {LayerDefinition} from "../LayerDefinition";
import {And, Or, Tag} from "../../Logic/TagsFilter";
import {OperatorTag} from "../Questions/OperatorTag";
import * as L from "leaflet";
import FixedName from "../Questions/FixedName";
import { BikeParkingType } from "../Questions/BikeParkingType";
export class BikeParkings extends LayerDefinition {
constructor() {
super();
this.name = "bike_parking";
this.icon = "./assets/bike_pump.svg";
this.overpassFilter = new Or([
new And([
new Tag("amenity", "bicycle_parking")
])
]);
this.newElementTags = [
new Tag("amenity", "bicycle_parking"),
];
this.maxAllowedOverlapPercentage = 10;
this.minzoom = 13;
this.style = this.generateStyleFunction();
this.title = new FixedName("fietsparking");
this.elementsToShow = [
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,
iconSize: [40, 40]
})
};
};
}
}

View file

@ -1,9 +1,6 @@
import {LayerDefinition} from "../LayerDefinition"; import {LayerDefinition} from "../LayerDefinition";
import {And, Or, Tag} from "../../Logic/TagsFilter"; import {And, Or, Tag} from "../../Logic/TagsFilter";
import {AccessTag} from "../Questions/AccessTag";
import {OperatorTag} from "../Questions/OperatorTag"; import {OperatorTag} from "../Questions/OperatorTag";
import {NameQuestion} from "../Questions/NameQuestion";
import {NameInline} from "../Questions/NameInline";
import * as L from "leaflet"; import * as L from "leaflet";
import { PumpManual } from "../Questions/PumpManual"; import { PumpManual } from "../Questions/PumpManual";
import FixedName from "../Questions/FixedName"; import FixedName from "../Questions/FixedName";

View file

@ -1,13 +1,14 @@
import {Layout} from "../Layout"; import {Layout} from "../Layout";
import {GrbToFix} from "../Layers/GrbToFix"; import {GrbToFix} from "../Layers/GrbToFix";
import { BikePumps } from "../Layers/BikePumps"; import { BikePumps } from "../Layers/BikePumps";
import { BikeParkings } from "../Layers/BikeParkings";
export class BikePumpsLayout extends Layout { export default class Cyclofix extends Layout {
constructor() { constructor() {
super( super(
"pomp", "pomp",
"Cyclofix", "Grb import fix tool",
[new BikePumps()], [new BikePumps(), new BikeParkings()],
15, 15,
51.2083, 51.2083,
3.2279, 3.2279,

View file

@ -0,0 +1,31 @@
import {TagRenderingOptions} from "../TagRendering";
import {Tag} from "../../Logic/TagsFilter";
export class BikeParkingType extends TagRenderingOptions {
private static options = {
priority: 5,
question: "Van welk type is deze fietsenparking?",
freeform: {
key: "bicycle_parking",
extraTags: new Tag("fixme", "Freeform bicycle_parking= tag used: possibly a wrong value"),
template: "Iets anders: $$$",
renderTemplate: "Dit is een fietsenparking van het type: {bicycle_parking}",
placeholder: "Specifieer"
},
mappings: [
{k: new Tag("bicycle_parking", "stands"), txt: "<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Bike_racks_at_north-west_of_Westfield_-_geograph.org.uk_-_1041057.jpg/100px-Bike_racks_at_north-west_of_Westfield_-_geograph.org.uk_-_1041057.jpg\">"},
{k: new Tag("bicycle_parking", "wall_loops"), txt: "<img src=\"https://wiki.openstreetmap.org/w/images/thumb/c/c2/Bike-parking-wheelbender.jpg/100px-Bike-parking-wheelbender.jpg\">"},
{k: new Tag("bicycle_parking", "handlebar_holder"), txt: "<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Bicycle_parking_handlebar_holder.jpg/100px-Bicycle_parking_handlebar_holder.jpg\">"},
{k: new Tag("bicycle_parking", "shed"), txt: "<img src=\"https://wiki.openstreetmap.org/w/images/thumb/b/b2/Bike-shelter.jpg/100px-Bike-shelter.jpg\">"},
{k: new Tag("bicycle_parking", "two-tier"), txt: "<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Bicis_a_l%27estaci%C3%B3_de_Leiden.JPG/100px-Bicis_a_l%27estaci%C3%B3_de_Leiden.JPG\">"}
]
}
constructor() {
super(BikeParkingType.options);
}
}

View file

@ -1,6 +1,9 @@
# MapComplete # MapComplete
MapComplete attempts to be a webversion of StreetComplete. > Let a thousand flowers bloom
MapComplete attempts to be a webversion of StreetComplete. However, we focus on 'themes', a bit similar as mapcontrib.
The design goals of MapComplete are to be: The design goals of MapComplete are to be: