forked from MapComplete/MapComplete
Bike pumps added layer & layout
This commit is contained in:
parent
41341470db
commit
75a3a70afa
6 changed files with 104 additions and 2 deletions
|
@ -3,6 +3,7 @@ import {Toilets} from "./Layouts/Toilets";
|
|||
import {GRB} from "./Layouts/GRB";
|
||||
import {Statues} from "./Layouts/Statues";
|
||||
import {Bookcases} from "./Layouts/Bookcases";
|
||||
import { BikePumps } from "./Layers/BikePumps";
|
||||
|
||||
export class AllKnownLayouts {
|
||||
public static allSets: any = AllKnownLayouts.AllLayouts();
|
||||
|
@ -11,6 +12,7 @@ export class AllKnownLayouts {
|
|||
const layouts = [
|
||||
new Groen(),
|
||||
new GRB(),
|
||||
new BikePumps(),
|
||||
/*new Toilets(),
|
||||
new Statues(),
|
||||
new Bookcases()*/
|
||||
|
|
77
Customizations/Layers/BikePumps.ts
Normal file
77
Customizations/Layers/BikePumps.ts
Normal file
|
@ -0,0 +1,77 @@
|
|||
import {LayerDefinition} from "../LayerDefinition";
|
||||
import {And, Or, Tag} from "../../Logic/TagsFilter";
|
||||
import {AccessTag} from "../Questions/AccessTag";
|
||||
import {OperatorTag} from "../Questions/OperatorTag";
|
||||
import {NameQuestion} from "../Questions/NameQuestion";
|
||||
import {NameInline} from "../Questions/NameInline";
|
||||
import * as L from "leaflet";
|
||||
|
||||
export class BikePumps extends LayerDefinition {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.name = "pomp";
|
||||
this.icon = "./assets/bike_pump.svg";
|
||||
|
||||
this.overpassFilter = new Or([
|
||||
new And([
|
||||
new Tag("amenity", "compressed_air"),
|
||||
new Tag("bicycle", "yes"),
|
||||
])
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
this.newElementTags = [
|
||||
new Tag("amenity", "compressed_air"),
|
||||
new Tag("bicycle", "yes"),
|
||||
// new Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")
|
||||
];
|
||||
this.maxAllowedOverlapPercentage = 10;
|
||||
|
||||
this.minzoom = 13;
|
||||
this.style = this.generateStyleFunction();
|
||||
this.title = new NameInline("pomp");
|
||||
this.elementsToShow = [
|
||||
// new NameQuestion(),
|
||||
// new AccessTag(),
|
||||
new OperatorTag()
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
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]
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}
|
23
Customizations/Layouts/BikePumps.ts
Normal file
23
Customizations/Layouts/BikePumps.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import {Layout} from "../Layout";
|
||||
import {GrbToFix} from "../Layers/GrbToFix";
|
||||
import { BikePumps } from "../Layers/BikePumps";
|
||||
|
||||
export class GRB extends Layout {
|
||||
constructor() {
|
||||
super(
|
||||
"pomp",
|
||||
"Grb import fix tool",
|
||||
[new BikePumps()],
|
||||
15,
|
||||
51.2083,
|
||||
3.2279,
|
||||
|
||||
|
||||
"<h3>GRB Fix tool</h3>\n" +
|
||||
"\n" +
|
||||
"Expert use only"
|
||||
|
||||
,
|
||||
"", "");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue