mapcomplete/Customizations/Layers/BikeParkings.ts

45 lines
1.4 KiB
TypeScript
Raw Normal View History

import {LayerDefinition} from "../LayerDefinition";
import {And, Or, Tag} from "../../Logic/TagsFilter";
import {OperatorTag} from "../Questions/OperatorTag";
import * as L from "leaflet";
import FixedText from "../Questions/FixedText";
2020-07-16 13:56:10 +00:00
import ParkingType from "../Questions/bike/ParkingType";
2020-07-16 07:54:32 +00:00
import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
2020-07-16 13:56:10 +00:00
export default class BikeParkings extends LayerDefinition {
constructor() {
super();
this.name = "bike_parking";
2020-07-16 13:56:10 +00:00
this.icon = "./assets/bike/parking.svg";
this.overpassFilter = new Tag("amenity", "bicycle_parking");
this.newElementTags = [
new Tag("amenity", "bicycle_parking"),
];
this.maxAllowedOverlapPercentage = 10;
this.minzoom = 13;
this.style = this.generateStyleFunction();
2020-07-16 07:54:32 +00:00
this.title = new FixedText("Fietsparking");
this.elementsToShow = [
2020-07-16 07:54:32 +00:00
new ImageCarouselWithUploadConstructor(),
new OperatorTag(),
2020-07-16 13:56:10 +00:00
new ParkingType()
];
}
private generateStyleFunction() {
const self = this;
return function (properties: any) {
return {
color: "#00bb00",
2020-07-16 13:56:10 +00:00
icon: L.icon({
iconUrl: self.icon,
2020-07-16 14:25:27 +00:00
iconSize: [50, 50]
})
};
};
}
2020-07-16 13:56:10 +00:00
}