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 = []
// This is a legacy format, lets create a pointRendering
let location: ("point" | "centroid")[] = ["point"]

View file

@ -15,12 +15,12 @@
"maintainer": "Sebastian Kürten",
"icon": "./assets/themes/cyclenodes/logo.svg",
"version": "0",
"hideFromOverview": true,
"startLat": 51.755515,
"startLon": 14.327545,
"startZoom": 11,
"widenFactor": 0.05,
"roamingRenderings": [],
"clustering":{
"clustering": {
"maxZoom": 11,
"minNeededElements": 1000000
},
@ -34,7 +34,8 @@
"osmTags": {
"and": [
"network=rcn",
"network:type=node_network"
"network:type=node_network",
"route=bicycle"
]
}
},
@ -52,12 +53,16 @@
}
]
},
"width": {
"render": "4"
},
"color": {
"render": "#00a703"
},
"mapRendering": [
{
"width": {
"render": "4"
},
"color": {
"render": "#00a703"
}
}
],
"tagRenderings": [
{
"question": {
@ -75,8 +80,10 @@
"if": "survey:date:={_now:date}",
"then": "Surveyed today!"
}
]
}
],
"id": "node2node-survey:date"
},
"export_as_gpx"
]
},
{
@ -86,12 +93,31 @@
},
"source": {
"osmTags": {
"or": [
"network:type=node_network",
"and": [
"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,
"title": {
"render": {
@ -99,18 +125,6 @@
"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": [
{
"title": {
@ -147,7 +161,8 @@
"if": "survey:date:={_now:date}",
"then": "Surveyed today!"
}
]
],
"id": "node-survey:date"
},
{
"question": {
@ -159,10 +174,11 @@
"freeform": {
"key": "expected_rcn_route_relations",
"type": "int"
}
},
"id": "node-expected_rcn_route_relations"
},
"images"
]
}
]
}
}

View file

@ -9,12 +9,20 @@ import LegacyJsonConvert from "../Models/ThemeConfig/LegacyJsonConvert";
const layerFiles = ScriptUtils.getLayerFiles();
for (const layerFile of layerFiles) {
LegacyJsonConvert.fixLayerConfig(layerFile.parsed)
writeFileSync(layerFile.path, JSON.stringify(layerFile.parsed, null, " "))
try {
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()
for (const themeFile of themeFiles) {
LegacyJsonConvert.fixThemeConfig(themeFile.parsed)
writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, " "))
try {
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)
}
}