Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Add (unused) circuits label

Russ Garrett7b8770243c08
diff --git a/src/style_oim_power.js b/src/style_oim_power.js
index 353367d..875009f 100644
--- a/src/style_oim_power.js
+++ b/src/style_oim_power.js
@@ -184,12 +184,21 @@ const freq = ["case",
""
];
+// TODO: circuits not in DB :(
+const circuits = ["case",
+ ["all",
+ ["has", "circuits"],
+ [">", ["to-number", ["get", "circuits"]], 1]
+ ],
+ ["concat", ["get", "circuits"], "×"],
+ ""
+]
const line_label = ["case",
["all", ["has", "voltage"], ["!=", ["get", "name"], ""]],
- ["concat", ["get", "name"], " (", ["get", "voltage"], " kV", freq, ")"],
+ ["concat", ["get", "name"], " (", circuits, ["get", "voltage"], " kV", freq, ")"],
["has", "voltage"],
- ["concat", ["get", "voltage"], " kV", freq],
+ ["concat", circuits, ["get", "voltage"], " kV", freq],
["get", "name"]
];