forked from MapComplete/MapComplete
Switched to regex for service:bicycle:
This commit is contained in:
parent
c6a80034ed
commit
71b1e80a1f
3 changed files with 55 additions and 52 deletions
|
@ -12,37 +12,27 @@ import CafePump from "../Questions/bike/CafePump";
|
|||
|
||||
|
||||
export default class BikeCafes extends LayerDefinition {
|
||||
private readonly repairsBikes = anyValueExcept("service:bicycle:repair", "no")
|
||||
private readonly hasPump = new Tag("service:bicycle:pump", "yes")
|
||||
private readonly diy = new Tag("service:bicycle:diy", "yes")
|
||||
private readonly bikeServices = [
|
||||
this.diy,
|
||||
this.repairsBikes,
|
||||
this.hasPump
|
||||
]
|
||||
private readonly to = Translations.t.cyclofix.cafe
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.name = this.to.name;
|
||||
this.icon = "./assets/bike/cafe.svg";
|
||||
super()
|
||||
this.name = this.to.name
|
||||
this.icon = "./assets/bike/cafe.svg"
|
||||
this.overpassFilter = new And([
|
||||
new Tag("amenity", /^pub|bar|cafe$/),
|
||||
new Or([
|
||||
new Regex("amenity", "^pub|bar|cafe")
|
||||
]),
|
||||
new Or([
|
||||
...this.bikeServices,
|
||||
new Tag(/^service:bicycle:/, "*"),
|
||||
new Tag("pub", "cycling")
|
||||
])
|
||||
])
|
||||
this.newElementTags = [
|
||||
new Tag("amenity", "pub"),
|
||||
new Tag("pub", "cycling"),
|
||||
];
|
||||
this.maxAllowedOverlapPercentage = 10;
|
||||
]
|
||||
this.maxAllowedOverlapPercentage = 10
|
||||
|
||||
this.minzoom = 13;
|
||||
this.style = this.generateStyleFunction();
|
||||
this.minzoom = 13
|
||||
this.style = this.generateStyleFunction()
|
||||
this.title = new FixedText(this.to.title)
|
||||
this.elementsToShow = [
|
||||
new ImageCarouselWithUploadConstructor(),
|
||||
|
@ -52,13 +42,12 @@ export default class BikeCafes extends LayerDefinition {
|
|||
new CafeRepair(),
|
||||
new CafeDiy(),
|
||||
new CafePump()
|
||||
];
|
||||
this.wayHandling = LayerDefinition.WAYHANDLING_CENTER_AND_WAY;
|
||||
|
||||
]
|
||||
this.wayHandling = LayerDefinition.WAYHANDLING_CENTER_AND_WAY
|
||||
}
|
||||
|
||||
private generateStyleFunction() {
|
||||
const self = this;
|
||||
const self = this
|
||||
return function (properties: any) {
|
||||
return {
|
||||
color: "#00bb00",
|
||||
|
@ -67,7 +56,7 @@ export default class BikeCafes extends LayerDefinition {
|
|||
iconSize: [50, 50],
|
||||
iconAnchor: [25,50]
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,19 +16,6 @@ import Website from "../Questions/Website";
|
|||
|
||||
export default class BikeOtherShops extends LayerDefinition {
|
||||
private readonly sellsBikes = new Tag("service:bicycle:retail", "yes")
|
||||
private readonly repairsBikes = anyValueExcept("service:bicycle:repair", "no")
|
||||
private readonly rentsBikes = new Tag("service:bicycle:rental", "yes")
|
||||
private readonly hasPump = new Tag("service:bicycle:pump", "yes")
|
||||
private readonly hasDiy = new Tag("service:bicycle:diy", "yes")
|
||||
private readonly sellsSecondHand = anyValueExcept("service:bicycle:repair", "no")
|
||||
private readonly hasBikeServices = new Or([
|
||||
this.sellsBikes,
|
||||
this.repairsBikes,
|
||||
// this.rentsBikes,
|
||||
// this.hasPump,
|
||||
// this.hasDiy,
|
||||
// this.sellsSecondHand
|
||||
])
|
||||
|
||||
private readonly to = Translations.t.cyclofix.nonBikeShop
|
||||
|
||||
|
@ -38,7 +25,7 @@ export default class BikeOtherShops extends LayerDefinition {
|
|||
this.icon = "./assets/bike/non_bike_repair_shop.svg"
|
||||
this.overpassFilter = new And([
|
||||
anyValueExcept("shop", "bicycle"),
|
||||
this.hasBikeServices
|
||||
new Tag(/^service:bicycle:/, "*"),
|
||||
])
|
||||
this.newElementTags = undefined
|
||||
this.maxAllowedOverlapPercentage = 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue