Fixes to cyclenode theme

This commit is contained in:
Pieter Vander Vennet 2021-11-21 03:48:05 +01:00
parent efece77b69
commit 9b7f8bfa47
3 changed files with 57 additions and 33 deletions

View file

@ -29,7 +29,7 @@ export default class LegacyJsonConvert {
} }
} }
if (config.mapRendering === undefined && config.id !== "sidewalks") { if (config.mapRendering === undefined) {
config.mapRendering = [] config.mapRendering = []
// This is a legacy format, lets create a pointRendering // This is a legacy format, lets create a pointRendering
let location: ("point" | "centroid")[] = ["point"] let location: ("point" | "centroid")[] = ["point"]

View file

@ -15,12 +15,12 @@
"maintainer": "Sebastian Kürten", "maintainer": "Sebastian Kürten",
"icon": "./assets/themes/cyclenodes/logo.svg", "icon": "./assets/themes/cyclenodes/logo.svg",
"version": "0", "version": "0",
"hideFromOverview": true,
"startLat": 51.755515, "startLat": 51.755515,
"startLon": 14.327545, "startLon": 14.327545,
"startZoom": 11, "startZoom": 11,
"widenFactor": 0.05, "widenFactor": 0.05,
"roamingRenderings": [], "clustering": {
"clustering":{
"maxZoom": 11, "maxZoom": 11,
"minNeededElements": 1000000 "minNeededElements": 1000000
}, },
@ -34,7 +34,8 @@
"osmTags": { "osmTags": {
"and": [ "and": [
"network=rcn", "network=rcn",
"network:type=node_network" "network:type=node_network",
"route=bicycle"
] ]
} }
}, },
@ -52,12 +53,16 @@
} }
] ]
}, },
"width": { "mapRendering": [
"render": "4" {
}, "width": {
"color": { "render": "4"
"render": "#00a703" },
}, "color": {
"render": "#00a703"
}
}
],
"tagRenderings": [ "tagRenderings": [
{ {
"question": { "question": {
@ -75,8 +80,10 @@
"if": "survey:date:={_now:date}", "if": "survey:date:={_now:date}",
"then": "Surveyed today!" "then": "Surveyed today!"
} }
] ],
} "id": "node2node-survey:date"
},
"export_as_gpx"
] ]
}, },
{ {
@ -86,12 +93,31 @@
}, },
"source": { "source": {
"osmTags": { "osmTags": {
"or": [ "and": [
"network:type=node_network",
"rcn_ref~*" "rcn_ref~*"
] ]
} }
}, },
"mapRendering": [
{
"location": [
"point",
"centroid"
],
"label": {
"mappings": [
{
"if": "rcn_ref~*",
"then": "<div style='position: absolute; top: 10px; right: 10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>{rcn_ref}</div>"
},
{
"if": "rcn_ref=",
"then": "<div style='position: absolute; top: 10px; right: 10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>?</div>"
}
]
}
}
],
"minzoom": 12, "minzoom": 12,
"title": { "title": {
"render": { "render": {
@ -99,18 +125,6 @@
"de": "Knotenpunkt" "de": "Knotenpunkt"
} }
}, },
"label": {
"mappings": [
{
"if": "rcn_ref~*",
"then": "<div style='position: absolute; top: 10px; right: 10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>{rcn_ref}</div>"
},
{
"if": "rcn_ref=",
"then": "<div style='position: absolute; top: 10px; right: 10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>?</div>"
}
]
},
"presets": [ "presets": [
{ {
"title": { "title": {
@ -147,7 +161,8 @@
"if": "survey:date:={_now:date}", "if": "survey:date:={_now:date}",
"then": "Surveyed today!" "then": "Surveyed today!"
} }
] ],
"id": "node-survey:date"
}, },
{ {
"question": { "question": {
@ -159,10 +174,11 @@
"freeform": { "freeform": {
"key": "expected_rcn_route_relations", "key": "expected_rcn_route_relations",
"type": "int" "type": "int"
} },
"id": "node-expected_rcn_route_relations"
}, },
"images" "images"
] ]
} }
] ]
} }

View file

@ -9,12 +9,20 @@ import LegacyJsonConvert from "../Models/ThemeConfig/LegacyJsonConvert";
const layerFiles = ScriptUtils.getLayerFiles(); const layerFiles = ScriptUtils.getLayerFiles();
for (const layerFile of layerFiles) { for (const layerFile of layerFiles) {
LegacyJsonConvert.fixLayerConfig(layerFile.parsed) try {
writeFileSync(layerFile.path, JSON.stringify(layerFile.parsed, null, " ")) LegacyJsonConvert.fixLayerConfig(layerFile.parsed)
writeFileSync(layerFile.path, JSON.stringify(layerFile.parsed, null, " "))
} catch (e) {
console.error("COULD NOT LINT LAYER" + layerFile.path + ":\n\t" + e)
}
} }
const themeFiles = ScriptUtils.getThemeFiles() const themeFiles = ScriptUtils.getThemeFiles()
for (const themeFile of themeFiles) { for (const themeFile of themeFiles) {
LegacyJsonConvert.fixThemeConfig(themeFile.parsed) try {
writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, " ")) LegacyJsonConvert.fixThemeConfig(themeFile.parsed)
writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, " "))
} catch (e) {
console.error("COULD NOT LINT THEME" + themeFile.path + ":\n\t" + e)
}
} }