Bike pumps added layer & layout

This commit is contained in:
Pieter Fiers 2020-07-07 16:00:27 +02:00
parent 41341470db
commit 75a3a70afa
6 changed files with 104 additions and 2 deletions

View file

@ -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()*/

View 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]
})
};
};
}
}

View 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"
,
"", "");
}
}

1
assets/bike_pump.svg Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" ?><svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><g id="outline"><path d="M18.253,60.667a4.535,4.535,0,1,0,6.414-6.414L20.914,50.5,22,49.414l.793.793a4.539,4.539,0,0,0,6.414,0l22-22a2.535,2.535,0,1,1,3.585,3.586L36.59,50.005l-.712-.712a1,1,0,0,0-1.4-.01l-3.263,3.173a5,5,0,0,0-.049,7.12l2.131,2.131a1,1,0,0,0,1.414,0l3-3a1,1,0,0,0-.015-1.428l-1.357-1.3,2.382-2.45a1,1,0,0,0-.01-1.4l-.7-.7,18.2-18.212a4.535,4.535,0,0,0-6.414-6.414l-22,22a2.54,2.54,0,0,1-3.586,0L23.414,48,45.207,26.207a1,1,0,0,0,0-1.414L44.414,24,50.5,17.914l6.293,6.293a1,1,0,0,0,1.414,0l3.5-3.5a1,1,0,0,0,0-1.414l-17-17a1,1,0,0,0-1.414,0l-3.5,3.5a1,1,0,0,0,0,1.414L46.086,13.5,40,19.586l-.793-.793a1,1,0,0,0-1.414,0L13.5,43.086,9.747,39.333a4.535,4.535,0,1,0-6.414,6.414ZM34.2,55.3a1,1,0,0,0,.024,1.418l1.347,1.294L34,59.586l-1.424-1.424a3,3,0,0,1,.03-4.273L35.162,51.4,36.6,52.838ZM41.914,6.5,44,4.414,59.586,20,57.5,22.086l-6.293-6.293-3-3ZM47.5,14.914,49.086,16.5,43,22.586,41.414,21Zm-9,6,.793.793,3,3,.793.793L22,46.586,17.414,42ZM16,43.414,20.586,48,17.5,51.086,12.914,46.5ZM4.747,40.747a2.585,2.585,0,0,1,3.586,0L12.086,44.5l-1.293,1.293a1,1,0,0,0,0,1.414l6,6a1,1,0,0,0,1.414,0L19.5,51.914l3.753,3.753a2.525,2.525,0,0,1,0,3.586,2.585,2.585,0,0,1-3.586,0L4.747,44.333a2.525,2.525,0,0,1,0-3.586Z"/><rect height="2.828" transform="translate(-28.355 17.544) rotate(-45)" width="2" x="6" y="41.586"/><rect height="2.828" transform="translate(-34.154 31.544) rotate(-45)" width="2" x="20" y="55.586"/><rect height="2" transform="translate(-8.256 33.485) rotate(-45)" width="2.003" x="35.29" y="25.708"/><rect height="2" transform="translate(-14.485 30.905) rotate(-45)" width="11.49" x="24.317" y="31.938"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -9,7 +9,6 @@
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<link rel="stylesheet" href="./index.css"/>
<link rel="stylesheet" href="node_modules/@splidejs/splide/dist/css/splide.min.css">
</head>
<body>

View file

@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "parcel index.html land.html test.html assets/test.json assets/* UI/* Logic/* vendor/*",
"build": "parcel build --public-url ./ index.html land.html assets/*",
"build": "rm -rf dist/ && parcel build --public-url ./ index.html land.html assets/*",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [