Use new layerConfig in themes

This commit is contained in:
pietervdvn 2021-03-21 01:49:08 +01:00
parent 878cb6d47d
commit 75deed8097
12 changed files with 221 additions and 198 deletions

View file

@ -32,24 +32,6 @@ import AllKnownLayers from "./AllKnownLayers";
export class AllKnownLayouts {
public static allLayers: Map<string, LayerConfig> = undefined;
private static GenerateCycloFix(): LayoutConfig {
const layout = new LayoutConfig(cyclofix)
const now = new Date();
const m = now.getMonth() + 1;
const day = new Date().getDate() + 1;
const date = day + "/" + m;
if (date === "31/10" || date === "1/11" || date === "2/11") {
console.log("The current date is ",date,", which means we remember our dead")
// Around Halloween/Fiesta de muerte/Allerzielen, we remember the dead
layout.layers.push(
AllKnownLayers.sharedLayers.get("ghost_bike")
);
}
return layout;
}
public static layoutsList: LayoutConfig[] = [
new LayoutConfig(personal),
AllKnownLayouts.GenerateCycloFix(),
@ -79,10 +61,26 @@ export class AllKnownLayouts {
new LayoutConfig(speelplekken),
new LayoutConfig(sport_pitches)
];
public static allSets: Map<string, LayoutConfig> = AllKnownLayouts.AllLayouts();
private static GenerateCycloFix(): LayoutConfig {
const layout = new LayoutConfig(cyclofix)
const now = new Date();
const m = now.getMonth() + 1;
const day = new Date().getDate() + 1;
const date = day + "/" + m;
if (date === "31/10" || date === "1/11" || date === "2/11") {
console.log("The current date is ", date, ", which means we remember our dead")
// Around Halloween/Fiesta de muerte/Allerzielen, we remember the dead
layout.layers.push(
AllKnownLayers.sharedLayers.get("ghost_bike")
);
}
return layout;
}
private static AllLayouts(): Map<string, LayoutConfig> {
this.allLayers = new Map<string, LayerConfig>();
for (const layout of this.layoutsList) {

View file

@ -41,7 +41,9 @@
"nl": "Defibrillatoren",
"de": "Defibrillatoren"
},
"overpassTags": "emergency=defibrillator",
"source": {
"osmTags": "emergency=defibrillator"
},
"minzoom": 12,
"title": {
"render": {

View file

@ -33,7 +33,9 @@
"fr": "Œuvres d'art",
"de": "Kunstwerke"
},
"overpassTags": "tourism=artwork",
"source": {
"osmTags": "tourism=artwork"
},
"title": {
"render": {
"en": "Artwork",

View file

@ -34,11 +34,13 @@
"nl": "Natuurgebied"
},
"minzoom": 12,
"overpassTags": {
"source": {
"osmTags": {
"or": [
"leisure=nature_reserve",
"boundary=protected_area"
]
}
},
"title": {
"render": {
@ -131,11 +133,13 @@
"nl": "Park"
},
"minzoom": 12,
"overpassTags": {
"source": {
"osmTags": {
"or": [
"leisure=park",
"landuse=village_green"
]
}
},
"title": {
"render": {
@ -215,12 +219,14 @@
"nl": "Bos"
},
"minzoom": 12,
"overpassTags": {
"source": {
"osmTags": {
"or": [
"landuse=forest",
"natural=wood",
"natural=scrub"
]
}
},
"title": {
"render": {
@ -330,7 +336,9 @@
},
"freeform": {
"key": "access:description",
"addExtraTags": ["access="]
"addExtraTags": [
"access="
]
},
"mappings": [
{

View file

@ -1,4 +1,3 @@
{
"id": "campersite",
"title": {
@ -28,11 +27,13 @@
"en": "Camper sites"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"tourism=caravan_site",
"permanent_camping!~only"
]
}
},
"title": {
"render": {
@ -85,7 +86,8 @@
{
"if": {
"and": [
"fee=no","charge="
"fee=no",
"charge="
]
},
"then": {
@ -360,11 +362,13 @@
"en": "Sanitary dump stations"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"amenity=sanitary_dump_station",
"vehicle!~no"
]
}
},
"title": {
"render": {

View file

@ -27,10 +27,12 @@
"en": "Charging stations"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"amenity=charging_station"
]
}
},
"title": {
"render": {

View file

@ -37,7 +37,8 @@
"en": "Climbing club"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"or": [
"club=climbing",
{
@ -52,6 +53,7 @@
]
}
]
}
},
"title": {
"render": {
@ -160,11 +162,13 @@
"nl": "Klimzalen"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"sport=climbing",
"leisure=sports_centre"
]
}
},
"title": {
"render": {
@ -190,7 +194,8 @@
"tagRenderings": [
"images",
"questions",
{"#": "name",
{
"#": "name",
"render": {
"en": "<strong>{name}</strong>",
"nl": "<strong>{name}</strong>",
@ -236,10 +241,12 @@
"nl": "Klimroute"
},
"minzoom": 18,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"climbing=route"
]
}
},
"title": {
"render": {
@ -339,7 +346,8 @@
"en": "Climbing opportunities"
},
"minzoom": 10,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"sport=climbing",
"climbing!~route",
@ -347,6 +355,7 @@
"climbing!=route_top",
"climbing!=route_bottom"
]
}
},
"title": {
"render": {
@ -363,7 +372,8 @@
"tagRenderings": [
"images",
"questions",
{"#": "name",
{
"#": "name",
"render": {
"en": "<strong>{name}</strong>",
"nl": "<strong>{name}</strong>",
@ -435,7 +445,8 @@
"en": "Climbing opportunities?"
},
"minzoom": 19,
"overpassTags": {
"source": {
"osmTags": {
"or": [
"leisure=sports_centre",
"barrier=wall",
@ -444,6 +455,7 @@
"natural=rock",
"natural=stone"
]
}
},
"title": {
"render": {

View file

@ -96,11 +96,13 @@
"nl": "Fietsstraten"
},
"minzoom": 9,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"cyclestreet=yes",
"traffic_sign="
]
}
},
"description": {
"nl": "Een fietsstraat is een straat waar gemotoriseerd verkeer een fietser niet mag inhalen."
@ -123,7 +125,9 @@
},
"minzoom": 9,
"wayHandling": 0,
"overpassTags": "proposed:cyclestreet=yes",
"source": {
"osmTags": "proposed:cyclestreet=yes"
},
"title": {
"render": {
"nl": "Toekomstige fietsstraat"
@ -152,7 +156,9 @@
"description": {
"nl": "Laag waar je een straat als fietsstraat kan markeren"
},
"overpassTags": "highway~residential|tertiary|unclassified",
"source": {
"osmTags": "highway~residential|tertiary|unclassified"
},
"minzoom": 18,
"wayHandling": 0,
"title": {

View file

@ -27,10 +27,12 @@
"fr": "Friteries"
},
"minzoom": 8,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"cuisine~.*friture.*"
]
}
},
"title": {
"render": {

View file

@ -32,10 +32,12 @@
"fr": "Magasin"
},
"minzoom": 16,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"shop~*"
]
}
},
"title": {
"render": {

View file

@ -23,28 +23,13 @@
"widenFactor": 0.05,
"socialImage": "",
"defaultBackgroundId": "CartoDB.Positron",
"layersX": [
"layers": [
"play_forest",
"playground",
"sport_pitch",
"slow_roads",
"grass_in_parks",
"village_green"
],
"layers": [
{
"id": "test",
"source": {
"osmTags": "country~*",
"geoJsonSource": "https://pietervdvn.github.io/latlon2country/15.10774.14922.json"
},
"maxOverlapPercentage": 0,
"name": "test",
"title": "Test",
"minzoom": 0,
"maxzoom": 14
}
],
"roamingRenderings": []

View file

@ -13,14 +13,12 @@
"nl"
],
"hideFromOverview": true,
"enableUserBadge": false,
"enableShareScreen": false,
"enableMoreQuests": false,
"enableLayers": false,
"enableSearch": false,
"enableGeolocation": false,
"maintainer": "",
"icon": "./assets/themes/widths/icon.svg",
"version": "0",
@ -36,10 +34,12 @@
"nl": "Straten met een breedte"
},
"minzoom": 14,
"overpassTags": {
"source": {
"osmTags": {
"and": [
"width:carriageway~*"
]
}
},
"titleIcons": [],
"title": {