forked from MapComplete/MapComplete
		
	Fixes to cyclenode theme
This commit is contained in:
		
							parent
							
								
									efece77b69
								
							
						
					
					
						commit
						9b7f8bfa47
					
				
					 3 changed files with 57 additions and 33 deletions
				
			
		|  | @ -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"] | ||||||
|  |  | ||||||
|  | @ -15,11 +15,11 @@ | ||||||
|   "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 @@ | ||||||
|           } |           } | ||||||
|         ] |         ] | ||||||
|       }, |       }, | ||||||
|  |       "mapRendering": [ | ||||||
|  |         { | ||||||
|           "width": { |           "width": { | ||||||
|             "render": "4" |             "render": "4" | ||||||
|           }, |           }, | ||||||
|           "color": { |           "color": { | ||||||
|             "render": "#00a703" |             "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,19 +93,17 @@ | ||||||
|       }, |       }, | ||||||
|       "source": { |       "source": { | ||||||
|         "osmTags": { |         "osmTags": { | ||||||
|           "or": [ |           "and": [ | ||||||
|             "network:type=node_network", |  | ||||||
|             "rcn_ref~*" |             "rcn_ref~*" | ||||||
|           ] |           ] | ||||||
|         } |         } | ||||||
|       }, |       }, | ||||||
|       "minzoom": 12, |       "mapRendering": [ | ||||||
|       "title": { |         { | ||||||
|         "render": { |           "location": [ | ||||||
|           "en": "cycle node <strong>{rcn_ref}</strong>", |             "point", | ||||||
|           "de": "Knotenpunkt" |             "centroid" | ||||||
|         } |           ], | ||||||
|       }, |  | ||||||
|           "label": { |           "label": { | ||||||
|             "mappings": [ |             "mappings": [ | ||||||
|               { |               { | ||||||
|  | @ -110,6 +115,15 @@ | ||||||
|                 "then": "<div style='position: absolute; top: 10px; right: 10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>?</div>" |                 "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": { | ||||||
|  |           "en": "cycle node <strong>{rcn_ref}</strong>", | ||||||
|  |           "de": "Knotenpunkt" | ||||||
|  |         } | ||||||
|       }, |       }, | ||||||
|       "presets": [ |       "presets": [ | ||||||
|         { |         { | ||||||
|  | @ -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,7 +174,8 @@ | ||||||
|           "freeform": { |           "freeform": { | ||||||
|             "key": "expected_rcn_route_relations", |             "key": "expected_rcn_route_relations", | ||||||
|             "type": "int" |             "type": "int" | ||||||
|           } |           }, | ||||||
|  |           "id": "node-expected_rcn_route_relations" | ||||||
|         }, |         }, | ||||||
|         "images" |         "images" | ||||||
|       ] |       ] | ||||||
|  |  | ||||||
|  | @ -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) { | ||||||
|  |     try { | ||||||
|         LegacyJsonConvert.fixLayerConfig(layerFile.parsed) |         LegacyJsonConvert.fixLayerConfig(layerFile.parsed) | ||||||
|         writeFileSync(layerFile.path, JSON.stringify(layerFile.parsed, null, "  ")) |         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) { | ||||||
|  |     try { | ||||||
|         LegacyJsonConvert.fixThemeConfig(themeFile.parsed) |         LegacyJsonConvert.fixThemeConfig(themeFile.parsed) | ||||||
|         writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, "  ")) |         writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, "  ")) | ||||||
|  |     } catch (e) { | ||||||
|  |         console.error("COULD NOT LINT THEME" + themeFile.path + ":\n\t" + e) | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue