Merge branch 'bike-pumps' of github.com:pietervdvn/MapComplete into bike-pumps
This commit is contained in:
commit
07afc597c9
2 changed files with 8 additions and 7 deletions
|
@ -36,7 +36,7 @@ export default class BikeParkings extends LayerDefinition {
|
||||||
color: "#00bb00",
|
color: "#00bb00",
|
||||||
icon: L.icon({
|
icon: L.icon({
|
||||||
iconUrl: self.icon,
|
iconUrl: self.icon,
|
||||||
iconSize: [40, 40]
|
iconSize: [50, 50]
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {LayerDefinition} from "../LayerDefinition";
|
import {LayerDefinition} from "../LayerDefinition";
|
||||||
import {And, Tag, TagsFilter} from "../../Logic/TagsFilter";
|
import {And, Tag, TagsFilter, Or} from "../../Logic/TagsFilter";
|
||||||
import * as L from "leaflet";
|
import * as L from "leaflet";
|
||||||
import BikeStationChain from "../Questions/bike/StationChain";
|
import BikeStationChain from "../Questions/bike/StationChain";
|
||||||
import BikeStationPumpTools from "../Questions/bike/StationPumpTools";
|
import BikeStationPumpTools from "../Questions/bike/StationPumpTools";
|
||||||
|
@ -15,9 +15,10 @@ import PumpValves from "../Questions/bike/PumpValves";
|
||||||
|
|
||||||
|
|
||||||
export default class BikeStations extends LayerDefinition {
|
export default class BikeStations extends LayerDefinition {
|
||||||
private readonly pump: TagsFilter = new Tag("service:bicycle:pump", "yes");
|
private readonly pump = new Tag("service:bicycle:pump", "yes");
|
||||||
private readonly pumpOperational: TagsFilter = new Tag("service:bicycle:pump:operational_status", "yes");
|
private readonly pumpOperationalAny = new Tag("service:bicycle:pump:operational_status", "yes");
|
||||||
private readonly tools: TagsFilter = new Tag("service:bicycle:tools", "yes");
|
private readonly pumpOperationalOk = new Or([new Tag("service:bicycle:pump:operational_status", "yes"), new Tag("service:bicycle:pump:operational_status", "operational"), new Tag("service:bicycle:pump:operational_status", "ok")]);
|
||||||
|
private readonly tools = new Tag("service:bicycle:tools", "yes");
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
@ -59,7 +60,7 @@ export default class BikeStations extends LayerDefinition {
|
||||||
const self = this;
|
const self = this;
|
||||||
return function (properties: any) {
|
return function (properties: any) {
|
||||||
const hasPump = self.pump.matchesProperties(properties)
|
const hasPump = self.pump.matchesProperties(properties)
|
||||||
const isOperational = self.pumpOperational.matchesProperties(properties)
|
const isOperational = !self.pumpOperationalAny.matchesProperties(properties) || self.pumpOperationalOk.matchesProperties(properties)
|
||||||
const hasTools = self.tools.matchesProperties(properties)
|
const hasTools = self.tools.matchesProperties(properties)
|
||||||
let iconName = ""
|
let iconName = ""
|
||||||
if (hasPump) {
|
if (hasPump) {
|
||||||
|
@ -80,7 +81,7 @@ export default class BikeStations extends LayerDefinition {
|
||||||
color: "#00bb00",
|
color: "#00bb00",
|
||||||
icon: L.icon({
|
icon: L.icon({
|
||||||
iconUrl: iconUrl,
|
iconUrl: iconUrl,
|
||||||
iconSize: [40, 40]
|
iconSize: [50, 50]
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue