Navigation banner across the top (the next maneuver's arrow by Valhalla's type, distance, street, then…, lanes, the street being driven; maneuvers gain type/street/exit); the driving view (tilted to 3D) hides route numbers and minor roads' names, road labels further apart
CI / check (push) Successful in 22s
CI / deploy (push) Successful in 17s

This commit is contained in:
randy committed 2026-11-30 20:06:44 +01:00
1 parent e62eb90dc7
commit 27313b3101
7 files changed
+144 -22

No files matched your search

+8 -1
View File
@@ -256,11 +256,18 @@ module Maptool
speed_limits: along[:speed_limits], signals: along[:signals],
legs_km: legs.map { |leg| leg.dig("summary", "length") }, # to each via point, for rerouting
# lanes: Valhalla's [{directions:, valid:, active:}] bitmasks, at junctions that have them
maneuvers: legs.flat_map { |leg| leg["maneuvers"].map { |m| { text: m["instruction"], km: m["length"], lanes: m["lanes"] }.compact } } } }
# type: Valhalla's maneuver type (the arrow), street: the road it leads onto
maneuvers: legs.flat_map { |leg| leg["maneuvers"].map { |m| maneuver(m) } } } }
rescue ArgumentError, TypeError
raise RouteError, "invalid coordinates"
end
def self.maneuver(m)
{ text: m["instruction"], km: m["length"], type: m["type"], street: (m["begin_street_names"] || m["street_names"])&.first,
exit: m["roundabout_exit_count"], lanes: m["lanes"] }.compact
end
private_class_method :maneuver
# From Valhalla's per-edge attributes along the route:
# countries: [{ code: "AT", km:, motorway_km:, toll_km: }, ...] in route
# order (vignettes, tolls);