Driving menu Trip: the stops as big rows (look, ✓ passed, ↑ ↓, ✕), a stop at the crosshair, the start at the car, search of saved points and offline places; each leg's km and time (legs_s) and the total, in the route panel too; passed stops kept (not routed, dimmed, editable) — a reroute marks them instead of dropping them; /status.html: every status endpoint full width (the debug panel links it); the trip-as-plan-and-log model and planned-vs-driven colors in docs/TODO
This commit is contained in:
1 parent
0eb9d05cdc
commit
809e88ab1a
14 files changed
+517
-101
No files matched your search
@@ -126,12 +126,13 @@ class RoutingTest < Minitest::Test
|
||||
def test_route_picks_the_costing_by_weight_and_returns_a_line
|
||||
shape = "wdg|xA{ubdQc@w@"
|
||||
reply = JSON.generate(trip: { summary: { length: 1.5, time: 90 },
|
||||
legs: [{ shape: shape, maneuvers: [{ instruction: "Drive north.", length: 1.5, type: 2, street_names: ["Main"] }] }] })
|
||||
legs: [{ shape: shape, summary: { length: 1.5, time: 90 }, maneuvers: [{ instruction: "Drive north.", length: 1.5, type: 2, street_names: ["Main"] }] }] })
|
||||
# The per-country lookup failing (400) leaves the route as it is.
|
||||
request = serve_once("HTTP/1.1 200 OK\r\nContent-Length: #{reply.bytesize}\r\n\r\n#{reply}", "HTTP/1.1 400 Bad Request\r\nContent-Length: 2\r\n\r\n{}") do |url|
|
||||
route = Maptool::Routing.route(url, [[9.52, 47.14], [9.53, 47.15]], Maptool::Routing::DEFAULT_VEHICLES[1])
|
||||
assert_equal [2, "auto", "Drive north."], [route[:geometry][:coordinates].size, route[:properties][:costing], route[:properties][:maneuvers][0][:text]]
|
||||
assert_equal({ text: "Drive north.", km: 1.5, type: 2, street: "Main" }, route[:properties][:maneuvers][0])
|
||||
assert_equal [[1.5], [90]], route[:properties].values_at(:legs_km, :legs_s) # each leg's km and time, for the stops
|
||||
end
|
||||
assert_includes request, %("costing_options":{"auto":{"height":3.0,"width":2.3}})
|
||||
|
||||
|
||||
Reference in new issue
Block a user