Relinting themes, move rendering info to 'mapRendering'

This commit is contained in:
pietervdvn 2021-11-04 22:31:14 +01:00
parent f1f955233b
commit d3de5475cd
11 changed files with 573 additions and 420 deletions

View file

@ -16,12 +16,12 @@ export default class LegacyJsonConvert {
if (config.tagRenderings !== undefined) {
for (const tagRendering of config.tagRenderings) {
if (tagRendering["#"] !== undefined) {
tagRendering["id"] = tagRendering["#"]
delete tagRendering["#"]
}
if (tagRendering["id"] === undefined) {
if (tagRendering["freeform"]?.key !== undefined) {
if (tagRendering["#"] !== undefined) {
tagRendering["id"] = tagRendering["#"]
delete tagRendering["#"]
} else if (tagRendering["freeform"]?.key !== undefined) {
tagRendering["id"] = config.id + "-" + tagRendering["freeform"]["key"]
}
}

View file

@ -635,28 +635,6 @@
"questions",
"reviews"
],
"icon": {
"render": "circle:white;./assets/themes/campersite/caravan.svg",
"mappings": [
{
"if": {
"and": [
"fee=no"
]
},
"then": "circle:white;./assets/themes/campersite/caravan_green.svg"
}
]
},
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -684,7 +662,38 @@
}
}
],
"wayHandling": 2
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/themes/campersite/caravan.svg",
"mappings": [
{
"if": {
"and": [
"fee=no"
]
},
"then": "circle:white;./assets/themes/campersite/caravan_green.svg"
}
]
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#00f"
},
"width": {
"render": "8"
}
}
]
},
{
"id": "dumpstations",
@ -1051,18 +1060,6 @@
"id": "dumpstations-network"
}
],
"icon": {
"render": "circle:white;./assets/themes/campersite/sanitary_dump_station.svg"
},
"width": {
"render": "8"
},
"iconSize": {
"render": "32,32,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -1083,6 +1080,27 @@
"de": "Fügen Sie eine neue sanitäre Entsorgungsstation hinzu. Hier können Camper Abwasser oder chemischen Toilettenabfälle entsorgen. Oft gibt es auch Trinkwasser und Strom."
}
}
],
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/themes/campersite/sanitary_dump_station.svg"
},
"iconSize": {
"render": "32,32,center"
},
"location": [
"point"
]
},
{
"color": {
"render": "#00f"
},
"width": {
"render": "8"
}
}
]
}
],

View file

@ -153,25 +153,6 @@
"phone",
"opening_hours"
],
"icon": {
"render": "./assets/themes/climbing/club.svg"
},
"iconOverlays": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
}
],
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -218,7 +199,25 @@
}
}
],
"wayHandling": 1
"mapRendering": [
{
"icon": {
"render": "./assets/themes/climbing/club.svg"
},
"iconBadges": [
{
"if": "opening_hours~*",
"then": "isOpen"
}
],
"iconSize": {
"render": "40,40,center"
},
"location": [
"point"
]
}
]
},
{
"id": "climbing_gym",
@ -302,21 +301,25 @@
"opening_hours",
"reviews"
],
"icon": {
"render": "./assets/themes/climbing/climbing_gym.svg"
},
"iconOverlays": [
"mapRendering": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
"icon": {
"render": "./assets/themes/climbing/climbing_gym.svg"
},
"iconBadges": [
{
"if": "opening_hours~*",
"then": "isOpen"
}
],
"iconSize": {
"render": "40,40,center"
},
"location": [
"point"
]
}
],
"width": "0",
"iconSize": {
"render": "40,40,center"
},
"wayHandling": 1
]
},
{
"id": "climbing_route",
@ -513,18 +516,6 @@
},
"reviews"
],
"icon": {
"render": "circle:white;./assets/themes/climbing/climbing_route.svg"
},
"width": {
"render": "4"
},
"iconSize": {
"render": "28,28,center"
},
"color": {
"render": "#0f0"
},
"presets": [
{
"title": {
@ -539,7 +530,28 @@
]
}
],
"wayHandling": 2
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/themes/climbing/climbing_route.svg"
},
"iconSize": {
"render": "28,28,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#0f0"
},
"width": {
"render": "4"
}
}
]
},
{
"id": "climbing",
@ -765,18 +777,6 @@
},
"reviews"
],
"icon": {
"render": "./assets/themes/climbing/climbing_no_rope.svg"
},
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#d38d5fAA"
},
"presets": [
{
"tags": [
@ -800,7 +800,6 @@
}
}
],
"wayHandling": 2,
"calculatedTags": [
"_contained_climbing_routes_properties=feat.overlapWith('climbing_route').map(f => f.feat.properties).map(p => {return {id: p.id, name: p.name, 'climbing:grade:french': p['climbing:grade:french'], 'climbing:length': p['climbing:length']} })",
"_contained_climbing_routes=JSON.parse(feat.properties._contained_climbing_routes_properties ?? '[]').map(p => `<li><a href='#${p.id}'>${p.name ?? 'climbing route'}</a> (<b>${p['climbing:grade:french'] ?? 'unknown difficulty'}</b>, ${p['climbing:length'] ?? 'unkown length'} meter)</li>`).join('')",
@ -808,6 +807,28 @@
"_difficulty_hist=JSON.parse(feat.properties._contained_climbing_routes_properties ?? '[]').map(p => p['climbing:grade:french'])",
"_length_hist=JSON.parse(feat.properties._contained_climbing_routes_properties ?? '[]').map(p => p['climbing:length'])",
"_contained_climbing_routes_count=JSON.parse(feat.properties._contained_climbing_routes_properties ?? '[]').length"
],
"mapRendering": [
{
"icon": {
"render": "./assets/themes/climbing/climbing_no_rope.svg"
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#d38d5fAA"
},
"width": {
"render": "8"
}
}
]
},
{
@ -930,14 +951,22 @@
]
}
],
"icon": "./assets/themes/climbing/climbing_unknown.svg",
"width": {
"render": "2"
},
"color": {
"render": "#ddff55AA"
},
"wayHandling": 0
"mapRendering": [
{
"icon": "./assets/themes/climbing/climbing_unknown.svg",
"location": [
"point"
]
},
{
"color": {
"render": "#ddff55AA"
},
"width": {
"render": "2"
}
}
]
}
],
"overrideAll": {

View file

@ -116,39 +116,6 @@
"de": "Radschnellweg"
}
},
"width": {
"render": "4"
},
"color": {
"render": "#ff7392",
"mappings": [
{
"if": "state=",
"then": "#00acfc"
},
{
"if": "state=temporary",
"then": "#00acfc"
}
]
},
"dashArray": {
"render": "",
"mappings": [
{
"if": "state=temporary",
"then": "12 10"
},
{
"if": "note:state=has_highway_no",
"then": "0 8"
},
{
"if": "note:state=has_highway_under_construction",
"then": "12 10"
}
]
},
"filter": [
{
"id": "name-alt",
@ -236,6 +203,43 @@
}
]
}
],
"mapRendering": [
{
"color": {
"render": "#ff7392",
"mappings": [
{
"if": "state=",
"then": "#00acfc"
},
{
"if": "state=temporary",
"then": "#00acfc"
}
]
},
"width": {
"render": "4"
},
"dashArray": {
"render": "",
"mappings": [
{
"if": "state=temporary",
"then": "12 10"
},
{
"if": "note:state=has_highway_no",
"then": "0 8"
},
{
"if": "note:state=has_highway_under_construction",
"then": "12 10"
}
]
}
}
]
}
],

View file

@ -84,11 +84,20 @@
"de": "Eine Fahrradstraße ist eine Straße, auf der motorisierter Verkehr einen Radfahrer nicht überholen darf"
},
"title": "{name}",
"icon": "./assets/themes/cyclestreets/F111.svg",
"color": "#0000ff",
"width": "10",
"tagRenderings": [
"images"
],
"mapRendering": [
{
"icon": "./assets/themes/cyclestreets/F111.svg",
"location": [
"point"
]
},
{
"color": "#0000ff",
"width": "10"
}
]
},
{
@ -110,7 +119,6 @@
"de": "Diese Straße wird bald eine Fahrradstraße sein"
},
"minzoom": 9,
"wayHandling": 0,
"source": {
"osmTags": "proposed:cyclestreet=yes"
},
@ -136,11 +144,20 @@
}
]
},
"icon": "./assets/themes/cyclestreets/F113.svg",
"color": "#09f9dd",
"width": "5",
"tagRenderings": [
"images"
],
"mapRendering": [
{
"icon": "./assets/themes/cyclestreets/F113.svg",
"location": [
"point"
]
},
{
"color": "#09f9dd",
"width": "5"
}
]
},
{
@ -173,7 +190,6 @@
}
},
"minzoom": 18,
"wayHandling": 0,
"title": {
"render": {
"nl": "Straat",
@ -191,23 +207,32 @@
}
]
},
"icon": "./assets/svg/pencil.svg",
"width": "5",
"color": {
"render": "#aaaaaa",
"mappings": [
{
"then": "#0000ff",
"if": "cyclestreet=yes"
},
{
"then": "#09f9dd",
"if": "proposed:cyclestreet=yes"
}
]
},
"tagRenderings": [
"images"
],
"mapRendering": [
{
"icon": "./assets/svg/pencil.svg",
"location": [
"point"
]
},
{
"color": {
"render": "#aaaaaa",
"mappings": [
{
"then": "#0000ff",
"if": "cyclestreet=yes"
},
{
"then": "#09f9dd",
"if": "proposed:cyclestreet=yes"
}
]
},
"width": "5"
}
]
}
],

View file

@ -84,38 +84,6 @@
"fr": "Jardins muraux",
"de": "Fassadengärten"
},
"iconOverlays": [
{
"if": "plant~.*vine.*",
"then": "circle:white;./assets/themes/facadegardens/klimplant.svg",
"badge": true
},
{
"if": "plant~.*groundcover.*",
"then": "circle:white;./assets/themes/facadegardens/bodembedekker.svg",
"badge": true
},
{
"if": "edible=true",
"then": "circle:white;./assets/themes/facadegardens/eetbaar.svg",
"badge": true
},
{
"if": "rain_barel=yes",
"then": "circle:white;./assets/themes/facadegardens/gevelton.svg",
"badge": true
},
{
"if": "plant~.*shrub.*",
"then": "circle:white;./assets/themes/facadegardens/struik.svg",
"badge": true
},
{
"if": "plant~.*flower.*",
"then": "circle:white;./assets/themes/facadegardens/bloei.svg",
"badge": true
}
],
"tagRenderings": [
"images",
{
@ -396,44 +364,6 @@
"id": "facadegardens-description"
}
],
"icon": {
"render": "circle:white;./assets/themes/facadegardens/geveltuin.svg",
"mappings": [
{
"if": {
"and": [
"direct_sunlight=yes"
]
},
"then": "circle:white;./assets/themes/facadegardens/zon.svg"
},
{
"if": {
"and": [
"direct_sunlight=partial"
]
},
"then": "circle:white;./assets/themes/facadegardens/halfzon.svg"
},
{
"if": {
"and": [
"direct_sunlight=no"
]
},
"then": "circle:white;./assets/themes/facadegardens/schaduw.svg"
}
]
},
"width": {
"render": "8"
},
"iconSize": {
"render": "50,50,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -458,7 +388,71 @@
}
}
],
"wayHandling": 1
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/themes/facadegardens/geveltuin.svg",
"mappings": [
{
"if": {
"and": [
"direct_sunlight=yes"
]
},
"then": "circle:white;./assets/themes/facadegardens/zon.svg"
},
{
"if": {
"and": [
"direct_sunlight=partial"
]
},
"then": "circle:white;./assets/themes/facadegardens/halfzon.svg"
},
{
"if": {
"and": [
"direct_sunlight=no"
]
},
"then": "circle:white;./assets/themes/facadegardens/schaduw.svg"
}
]
},
"iconBadges": [
{
"if": "plant~.*vine.*",
"then": "circle:white;./assets/themes/facadegardens/klimplant.svg"
},
{
"if": "plant~.*groundcover.*",
"then": "circle:white;./assets/themes/facadegardens/bodembedekker.svg"
},
{
"if": "edible=true",
"then": "circle:white;./assets/themes/facadegardens/eetbaar.svg"
},
{
"if": "rain_barel=yes",
"then": "circle:white;./assets/themes/facadegardens/gevelton.svg"
},
{
"if": "plant~.*shrub.*",
"then": "circle:white;./assets/themes/facadegardens/struik.svg"
},
{
"if": "plant~.*flower.*",
"then": "circle:white;./assets/themes/facadegardens/bloei.svg"
}
],
"iconSize": {
"render": "50,50,center"
},
"location": [
"point"
]
}
]
}
]
}

View file

@ -177,31 +177,6 @@
"id": "hackerspaces-start_date"
}
],
"icon": {
"render": "./assets/themes/hackerspaces/glider.svg",
"mappings": [
{
"if": {
"and": [
"hackerspace=makerspace"
]
},
"then": {
"en": "./assets/themes/hackerspaces/led.png",
"de": "./assets/themes/hackerspaces/led.png"
}
}
]
},
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -231,14 +206,48 @@
}
}
],
"wayHandling": 2,
"source": {
"osmTags": {
"and": [
"leisure=hackerspace"
]
}
}
},
"mapRendering": [
{
"icon": {
"render": "./assets/themes/hackerspaces/glider.svg",
"mappings": [
{
"if": {
"and": [
"hackerspace=makerspace"
]
},
"then": {
"en": "./assets/themes/hackerspaces/led.png",
"de": "./assets/themes/hackerspaces/led.png"
}
}
]
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#00f"
},
"width": {
"render": "8"
}
}
]
}
]
}

View file

@ -313,18 +313,6 @@
},
"images"
],
"icon": {
"render": "./assets/themes/hailhydrant/hydrant.svg"
},
"width": {
"render": "8"
},
"iconSize": {
"render": "20,20,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -346,7 +334,28 @@
}
}
],
"wayHandling": 2
"mapRendering": [
{
"icon": {
"render": "./assets/themes/hailhydrant/hydrant.svg"
},
"iconSize": {
"render": "20,20,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#00f"
},
"width": {
"render": "8"
}
}
]
},
{
"id": "extinguisher",
@ -438,18 +447,6 @@
},
"images"
],
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji12_1f9ef.svg"
},
"width": {
"render": "8"
},
"iconSize": {
"render": "20,20,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -472,7 +469,19 @@
}
}
],
"wayHandling": 1
"mapRendering": [
{
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji12_1f9ef.svg"
},
"iconSize": {
"render": "20,20,center"
},
"location": [
"point"
]
}
]
},
{
"id": "fire_stations",
@ -493,7 +502,6 @@
]
}
},
"wayHandling": 2,
"title": {
"render": {
"en": "Fire Station",
@ -671,18 +679,6 @@
},
"images"
],
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji12_1f692.svg"
},
"width": {
"render": "1"
},
"iconSize": {
"render": "35,35,center"
},
"color": {
"render": "#c22"
},
"presets": [
{
"tags": [
@ -702,6 +698,28 @@
"de": "Eine Feuerwache ist ein Ort, an dem die Feuerwehrfahrzeuge und die Feuerwehrleute untergebracht sind, wenn sie nicht im Einsatz sind."
}
}
],
"mapRendering": [
{
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji12_1f692.svg"
},
"iconSize": {
"render": "35,35,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#c22"
},
"width": {
"render": "1"
}
}
]
},
{
@ -872,18 +890,6 @@
},
"images"
],
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji_1f691.svg"
},
"width": {
"render": "1"
},
"iconSize": {
"render": "35,35,center"
},
"color": {
"render": "#00f"
},
"presets": [
{
"tags": [
@ -904,7 +910,28 @@
}
}
],
"wayHandling": 2
"mapRendering": [
{
"icon": {
"render": "./assets/themes/hailhydrant/Twemoji_1f691.svg"
},
"iconSize": {
"render": "35,35,center"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#00f"
},
"width": {
"render": "1"
}
}
]
}
],
"defaultBackgroundId": "HDM_HOT"

View file

@ -43,7 +43,6 @@
"osmTags": "generator:source=wind"
},
"minzoom": 10,
"wayHandling": 1,
"title": {
"render": {
"en": "wind turbine",
@ -61,16 +60,6 @@
}
]
},
"icon": "./assets/themes/openwindpowermap/wind_turbine.svg",
"iconSize": "40, 40, bottom",
"label": {
"mappings": [
{
"if": "generator:output:electricity~^[0-9]+.*[W]$",
"then": "<div style='background-color: rgba(0,0,0,0.3); color: white; font-size: 8px; padding: 0.25em; border-radius:0.5em'>{generator:output:electricity}</div>"
}
]
},
"tagRenderings": [
{
"id": "turbine-output",
@ -243,6 +232,23 @@
}
]
}
],
"mapRendering": [
{
"icon": "./assets/themes/openwindpowermap/wind_turbine.svg",
"label": {
"mappings": [
{
"if": "generator:output:electricity~^[0-9]+.*[W]$",
"then": "<div style='background-color: rgba(0,0,0,0.3); color: white; font-size: 8px; padding: 0.25em; border-radius:0.5em'>{generator:output:electricity}</div>"
}
]
},
"iconSize": "40, 40, bottom",
"location": [
"point"
]
}
]
}
],

View file

@ -61,18 +61,6 @@
"render": "{minimap(18): height: 5rem; overflow: hidden; border-radius:3rem; }"
}
],
"icon": {
"render": "./assets/themes/postboxes/postbox.svg"
},
"width": {
"render": "1"
},
"iconSize": {
"render": "40,40,bottom"
},
"color": {
"render": "#DADADA"
},
"presets": [
{
"tags": [
@ -84,7 +72,6 @@
}
}
],
"wayHandling": 2,
"deletion": {
"softDeletionTags": {
"and": [
@ -92,7 +79,29 @@
"razed:amenity=post_box"
]
}
}
},
"mapRendering": [
{
"icon": {
"render": "./assets/themes/postboxes/postbox.svg"
},
"iconSize": {
"render": "40,40,bottom"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#DADADA"
},
"width": {
"render": "1"
}
}
]
},
{
"id": "postoffices",
@ -143,25 +152,6 @@
"id": "OH"
}
],
"icon": {
"render": "square:white;./assets/themes/postboxes/post_office.svg"
},
"iconOverlays": [
{
"if": "opening_hours~*",
"then": "isOpen",
"badge": true
}
],
"width": {
"render": "1"
},
"iconSize": {
"render": "40,40,bottom"
},
"color": {
"render": "#DADADA"
},
"presets": [
{
"tags": [
@ -173,7 +163,6 @@
}
}
],
"wayHandling": 2,
"filter": [
{
"id": "is_open",
@ -187,6 +176,34 @@
}
]
}
],
"mapRendering": [
{
"icon": {
"render": "square:white;./assets/themes/postboxes/post_office.svg"
},
"iconBadges": [
{
"if": "opening_hours~*",
"then": "isOpen"
}
],
"iconSize": {
"render": "40,40,bottom"
},
"location": [
"point",
"centroid"
]
},
{
"color": {
"render": "#DADADA"
},
"width": {
"render": "1"
}
}
]
}
]

View file

@ -62,23 +62,6 @@
},
"name": "Addresses to check",
"minzoom": 14,
"wayHandling": 1,
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_unknown.svg",
"mappings": [
{
"if": "_embedding_object:id~*",
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
},
{
"if": "_imported=yes",
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
}
]
},
"iconSize": {
"render": "40,40,center"
},
"title": {
"render": "Address to be determined"
},
@ -118,6 +101,29 @@
}
]
}
],
"mapRendering": [
{
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_unknown.svg",
"mappings": [
{
"if": "_embedding_object:id~*",
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
},
{
"if": "_imported=yes",
"then": "./assets/themes/uk_addresses/housenumber_unknown_small.svg"
}
]
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point"
]
}
]
},
{
@ -230,50 +236,59 @@
}
}
],
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_ok.svg",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
"mapRendering": [
{
"icon": {
"render": "./assets/themes/uk_addresses/housenumber_ok.svg",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"addr:street="
]
},
"then": "./assets/themes/uk_addresses/housenumber_unknown.svg"
}
]
},
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#00f",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
"then": "./assets/themes/uk_addresses/housenumber_unknown.svg"
}
]
},
"iconSize": {
"render": "40,40,center"
},
"location": [
"point"
]
},
{
"color": {
"render": "#00f",
"mappings": [
{
"if": {
"or": [
{
"and": [
"addr:housenumber=",
"nohousenumber!=yes"
]
},
"addr:street="
]
},
"addr:street="
]
},
"then": "#ff0"
"then": "#ff0"
}
]
},
"width": {
"render": "8"
}
]
}
}
]
},
{
"id": "named_streets",
@ -286,12 +301,21 @@
]
}
},
"color": {
"render": "#ccc"
},
"width": {
"render": "0"
}
"mapRendering": [
{
"location": [
"point"
]
},
{
"color": {
"render": "#ccc"
},
"width": {
"render": "0"
}
}
]
}
],
"enableShareScreen": false,