From c918d02893a3047340e56b4913b6d27460f3bc4f Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli <27171200+fcastrovilli@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:11:10 +0100 Subject: [PATCH 1/5] Expose structured maneuvers, route progress and fix kinematics in the navigation snapshot Native: keep raw OSRM maneuver facts (type, modifier, exit, name, ref, bearings, driving side) beside Ferrostar's parsed steps, index maneuvers into the immutable route geometry, and publish upcoming/following maneuvers with ids tied to the route revision, the route-relative progress offset, Ferrostar's snapped position with an alignment state, and speed/course/accuracies/monotonic fix time. Payloads stay free of null/NaN. TypeScript: snapshot types, a route measure using the native metric, and a pure first-person camera planner with deterministic fixtures (straight, turns, close turns, roundabout, U-turn, stop/start, deviation, degraded fixes, arrival, bearing wraparound, duplicate timestamps). --- .../navigation/FerrostarNavigationEngine.kt | 6 + .../avoid/maps/navigation/GuidanceModel.kt | 233 +++++++++++++ .../maps/navigation/NavigationRuntime.kt | 30 +- .../maps/navigation/GuidanceModelTest.kt | 194 +++++++++++ src/domain/navigation.ts | 57 +++- .../navigation/guidance-camera.test.ts | 179 ++++++++++ src/features/navigation/guidance-camera.ts | 318 ++++++++++++++++++ src/features/navigation/guidance-fixtures.ts | 81 +++++ src/features/navigation/map-projection.ts | 63 ++++ src/features/navigation/route-measure.test.ts | 28 ++ src/features/navigation/route-measure.ts | 104 ++++++ 11 files changed, 1291 insertions(+), 2 deletions(-) create mode 100644 modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/GuidanceModel.kt create mode 100644 modules/avoid-navigation/android/src/test/java/quest/avoid/maps/navigation/GuidanceModelTest.kt create mode 100644 src/features/navigation/guidance-camera.test.ts create mode 100644 src/features/navigation/guidance-camera.ts create mode 100644 src/features/navigation/guidance-fixtures.ts create mode 100644 src/features/navigation/map-projection.ts create mode 100644 src/features/navigation/route-measure.test.ts create mode 100644 src/features/navigation/route-measure.ts diff --git a/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/FerrostarNavigationEngine.kt b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/FerrostarNavigationEngine.kt index a87c8ab..5166ca6 100644 --- a/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/FerrostarNavigationEngine.kt +++ b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/FerrostarNavigationEngine.kt @@ -15,11 +15,17 @@ import uniffi.ferrostar.createNavigationSession /** Pure navigation core; Android owns lifecycle, fixes, network and speech. No SDK auto-rerouting. */ internal class FerrostarNavigationEngine(responseJson: String, mode: String, firstFix: Location) : AutoCloseable { val route: Route + /** Raw OSRM maneuver facts aligned with [route] steps (Ferrostar's public steps drop them). */ + val facts: List + val index: RouteGuideIndex private val config: NavigationControllerConfig private val session: NavigationSession private var state: NavState init { route = FerrostarRouteParser.parse(responseJson, mode) + facts = try { ManeuverFacts.parse(responseJson) } catch (_: org.json.JSONException) { throw NavigationFailure("invalid") } + if (facts.size != route.steps.size) throw NavigationFailure("invalid") + index = RouteGuideIndex(route.geometry, route.steps, facts) config = RoadGuidancePolicy.controllerConfig(mode) try { session = createNavigationSession(route, config, emptyList()) diff --git a/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/GuidanceModel.kt b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/GuidanceModel.kt new file mode 100644 index 0000000..afab7f3 --- /dev/null +++ b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/GuidanceModel.kt @@ -0,0 +1,233 @@ +package quest.avoid.maps.navigation + +import kotlin.math.abs +import kotlin.math.cos +import kotlin.math.roundToInt +import org.json.JSONObject +import uniffi.ferrostar.GeographicCoordinate +import uniffi.ferrostar.RouteStep + +/** + * Raw OSRM maneuver facts for one route step. Ferrostar 0.57's public route keeps the step geometry, + * distance and our Italian text, but the adapter empties its visual instructions, so the maneuver + * type, modifier and roundabout exit come from the provider response itself — never from parsing + * Italian prose back into types. + */ +internal data class ManeuverFacts( + val type: String, + val modifier: String?, + val exit: Int?, + val name: String?, + val ref: String?, + val latitude: Double, + val longitude: Double, + val bearingBefore: Int?, + val bearingAfter: Int?, + val drivingSide: String?, +) { + companion object { + /** One entry per OSRM step across every leg, in route order (the same order Ferrostar uses). */ + fun parse(responseJson: String): List { + val legs = JSONObject(responseJson).getJSONArray("routes").getJSONObject(0).getJSONArray("legs") + return (0 until legs.length()).flatMap { leg -> + val steps = legs.getJSONObject(leg).getJSONArray("steps") + (0 until steps.length()).map { from(steps.getJSONObject(it)) } + } + } + + fun from(step: JSONObject): ManeuverFacts { + val maneuver = step.optJSONObject("maneuver") ?: JSONObject() + val location = maneuver.optJSONArray("location") + val longitude = location?.optDouble(0, Double.NaN) ?: Double.NaN + val latitude = location?.optDouble(1, Double.NaN) ?: Double.NaN + fun bearing(key: String) = if (maneuver.has(key)) maneuver.optInt(key, -1).takeIf { it in 0..360 } else null + return ManeuverFacts( + type = text(maneuver.optString("type"), 32) ?: "unknown", + modifier = text(maneuver.optString("modifier"), 32)?.takeIf { it in MODIFIERS }, + exit = if (maneuver.has("exit")) maneuver.optInt("exit", 0).takeIf { it in 1..99 } else null, + name = text(step.optString("name"), 160), + ref = text(step.optString("ref"), 40), + latitude = latitude, longitude = longitude, + bearingBefore = bearing("bearing_before"), bearingAfter = bearing("bearing_after"), + drivingSide = text(step.optString("driving_side"), 8)?.takeIf { it == "left" || it == "right" }, + ) + } + + private val MODIFIERS = setOf("uturn", "sharp right", "right", "slight right", "straight", "slight left", "left", "sharp left") + private fun text(value: String?, limit: Int) = value?.replace(Regex("[\\p{Cntrl}\\s]+"), " ")?.trim()?.take(limit)?.takeIf { it.isNotEmpty() } + } +} + +/** + * Immutable per-route index: cumulative distance along the route geometry the interface renders and + * the route-geometry index of every maneuver. Progress is measured on exactly the bridged geometry, + * so the traveled/remaining split drawn on the map matches the snapped position. + */ +internal class RouteGuideIndex(private val geometry: List, steps: List, facts: List) { + val cumulative: DoubleArray = DoubleArray(geometry.size).also { sums -> + for (i in 1 until geometry.size) sums[i] = sums[i - 1] + distance(geometry[i - 1], geometry[i]) + } + val length: Double get() = cumulative.lastOrNull() ?: 0.0 + /** Route-geometry index of the point where step k's maneuver happens (its first point). */ + val maneuverIndex: IntArray + + init { + require(geometry.size >= 2 && steps.isNotEmpty()) + val indexes = IntArray(steps.size) + var from = 0 + steps.forEachIndexed { k, step -> + val fact = facts.getOrNull(k) + val target = step.geometry.firstOrNull() + ?: fact?.takeIf { NavigationGeometry.valid(it.latitude, it.longitude) }?.let { GeographicCoordinate(it.latitude, it.longitude) } + // Maneuvers advance monotonically; a U-turn folds the line back over itself, so search + // forward from the previous maneuver and stop at the first exact (or nearest) match. + indexes[k] = if (k == 0) 0 else if (target == null) from else nearestForward(target, from) + from = indexes[k] + } + maneuverIndex = indexes + } + + private fun nearestForward(target: GeographicCoordinate, from: Int): Int { + var best = from + var bestDistance = Double.MAX_VALUE + for (i in from until geometry.size) { + val d = distance(geometry[i], target) + if (d < 0.05) return i + if (d < bestDistance) { bestDistance = d; best = i } + } + return best + } + + data class Progress(val traveledMeters: Double, val segmentIndex: Int) + + /** + * Projects [position] onto the route between the current step's maneuver and the next maneuver + * (a bounded window, so a later stretch of a looping or U-turn route never captures it). + */ + fun progress(currentStep: Int, position: GeographicCoordinate): Progress { + val start = maneuverIndex.getOrElse(currentStep) { 0 }.coerceIn(0, geometry.size - 2) + val end = (maneuverIndex.getOrNull(currentStep + 1) ?: (geometry.size - 1)).coerceIn(start + 1, geometry.size - 1) + var bestSegment = start + var bestFraction = 0.0 + var bestDistance = Double.MAX_VALUE + for (i in start until end) { + val (fraction, d) = project(geometry[i], geometry[i + 1], position) + if (d < bestDistance) { bestDistance = d; bestSegment = i; bestFraction = fraction } + } + val segmentLength = cumulative[bestSegment + 1] - cumulative[bestSegment] + return Progress(cumulative[bestSegment] + bestFraction * segmentLength, bestSegment) + } + + companion object { + fun distance(a: GeographicCoordinate, b: GeographicCoordinate) = NavigationGeometry.distance(a.lat, a.lng, b.lat, b.lng) + + /** Local equirectangular projection of [p] on segment a–b: (fraction along, distance in metres). */ + fun project(a: GeographicCoordinate, b: GeographicCoordinate, p: GeographicCoordinate): Pair { + val k = cos(Math.toRadians(a.lat)) + val ax = 0.0; val ay = 0.0 + val bx = (b.lng - a.lng) * k; val by = b.lat - a.lat + val px = (p.lng - a.lng) * k; val py = p.lat - a.lat + val length2 = (bx - ax) * (bx - ax) + (by - ay) * (by - ay) + val t = if (length2 <= 0.0) 0.0 else (((px - ax) * (bx - ax) + (py - ay) * (by - ay)) / length2).coerceIn(0.0, 1.0) + val qx = ax + t * (bx - ax); val qy = ay + t * (by - ay) + val metres = Math.hypot(px - qx, py - qy) * 111_195.0 + return t to metres + } + } +} + +/** + * Structured snapshot fields for the interface: the upcoming and following maneuvers (stable ids + * tied to the route revision), the route-relative progress and Ferrostar's snapped position. Pure, + * so the JVM tests cover it with deterministic fixtures; native values never contain null or NaN. + */ +internal object GuidanceFields { + /** Ids are `:`; a reroute changes every id. */ + fun maneuverId(routeRevision: Long, index: Int) = "$routeRevision:$index" + + fun build( + routeRevision: Long, + index: RouteGuideIndex, + steps: List, + facts: List, + remainingSteps: Int, + snapped: GeographicCoordinate?, + alignment: String, + ): Map { + val fields = mutableMapOf() + // Ferrostar drops completed steps from the front; the current step is remainingSteps[0]. + val current = (steps.size - remainingSteps).coerceIn(0, steps.size - 1) + val upcoming = current + 1 + maneuver(routeRevision, index, steps, facts, upcoming)?.let { fields["upcomingManeuver"] = it } + maneuver(routeRevision, index, steps, facts, upcoming + 1)?.let { following -> + // Distance/time between the two maneuvers: the whole upcoming step. + val between = steps[upcoming] + fields["followingManeuver"] = following + mapOf( + "afterUpcomingMeters" to finite(between.distance), "afterUpcomingSeconds" to finite(between.duration), + ) + } + if (snapped != null && NavigationGeometry.valid(snapped.lat, snapped.lng)) { + val progress = index.progress(current, snapped) + fields["routeProgress"] = mapOf( + "traveledMeters" to round(progress.traveledMeters), "routeLengthMeters" to round(index.length), + "segmentIndex" to progress.segmentIndex, "stepIndex" to current, + ) + fields["snappedLocation"] = mapOf("latitude" to snapped.lat, "longitude" to snapped.lng) + } + fields["alignment"] = alignment + return fields + } + + private fun maneuver(routeRevision: Long, index: RouteGuideIndex, steps: List, facts: List, k: Int): Map? { + val step = steps.getOrNull(k) ?: return null + val fact = facts.getOrNull(k) + val geometryIndex = index.maneuverIndex.getOrElse(k) { 0 } + val point = step.geometry.firstOrNull() + val result = mutableMapOf( + "id" to maneuverId(routeRevision, k), "stepIndex" to k, "geometryIndex" to geometryIndex, + "type" to (fact?.type ?: "unknown"), "instruction" to step.instruction, + ) + val latitude = fact?.latitude?.takeIf { it.isFinite() } ?: point?.lat + val longitude = fact?.longitude?.takeIf { it.isFinite() } ?: point?.lng + if (latitude != null && longitude != null && NavigationGeometry.valid(latitude, longitude)) { + result["latitude"] = latitude; result["longitude"] = longitude + } + fact?.modifier?.let { result["modifier"] = it } + fact?.exit?.let { result["exit"] = it } + (fact?.name ?: step.roadName?.takeIf { it.isNotBlank() })?.let { result["name"] = it } + fact?.ref?.let { result["ref"] = it } + fact?.bearingBefore?.let { result["bearingBefore"] = it } + fact?.bearingAfter?.let { result["bearingAfter"] = it } + fact?.drivingSide?.let { result["drivingSide"] = it } + return result + } + + private fun finite(value: Double) = if (value.isFinite() && value >= 0) round(value) else 0.0 + private fun round(value: Double) = (value * 10).roundToInt() / 10.0 +} + +/** How credible Ferrostar's snapped position is for drawing the puck on the route. */ +internal object Alignment { + const val ALIGNED = "aligned" + const val DEVIATING = "deviating" + /** The fix was too coarse to judge deviation, or no route is installed. */ + const val UNKNOWN = "unknown" + fun of(judged: Boolean, offRoute: Boolean, deviation: Boolean): String = when { + offRoute || (judged && deviation) -> DEVIATING + judged -> ALIGNED + else -> UNKNOWN + } +} + +/** Fix kinematics for the camera: never NaN or negative; absent values are omitted. */ +internal object FixKinematics { + fun fields( + speed: Float?, speedAccuracy: Float?, course: Float?, courseAccuracy: Float?, elapsedRealtimeNanos: Long, + ): Map = buildMap { + speed?.takeIf { it.isFinite() && it >= 0f }?.let { put("speedMps", (it * 100).roundToInt() / 100.0) } + speedAccuracy?.takeIf { it.isFinite() && it > 0f }?.let { put("speedAccuracyMps", (it * 100).roundToInt() / 100.0) } + course?.takeIf { it.isFinite() }?.let { put("course", (((it.toDouble() % 360 + 360) % 360) * 10).roundToInt().rem(3600) / 10.0) } + courseAccuracy?.takeIf { it.isFinite() && it > 0f }?.let { put("courseAccuracyDegrees", abs(it).toDouble()) } + if (elapsedRealtimeNanos > 0) put("elapsedMs", elapsedRealtimeNanos / 1_000_000L) + } +} diff --git a/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/NavigationRuntime.kt b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/NavigationRuntime.kt index e3fa2e1..2c21a96 100644 --- a/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/NavigationRuntime.kt +++ b/modules/avoid-navigation/android/src/main/java/quest/avoid/maps/navigation/NavigationRuntime.kt @@ -379,6 +379,8 @@ internal class NavigationRuntime private constructor(private val context: Contex val (upcoming, following) = ItalianManeuvers.upcoming(state.remainingSteps) if (upcoming != null) fields["instruction"] = upcoming else fields.remove("instruction") if (following != null) fields["nextInstruction"] = following else fields.remove("nextInstruction") + publishGuidance(state.remainingSteps.size, state.snappedUserLocation.coordinates, + Alignment.of(judged, offRoute, state.deviation is RouteDeviation.Deviation)) fields["status"] = if (offRoute) "off-route" else "navigating" fields.remove("problem"); fields["canRetry"] = offRoute arrivalFixes = 0 @@ -411,6 +413,9 @@ internal class NavigationRuntime private constructor(private val context: Contex fields["status"] = "navigating"; fields.remove("problem"); fields["canRetry"] = false fields["instruction"] = "Stai arrivando a destinazione"; fields.remove("nextInstruction") fields["distanceRemainingMeters"] = result[0].toDouble() + // The final step is next: the arrival maneuver, measured from the route end. + publishGuidance(2, destination, Alignment.UNKNOWN) + fields.remove("followingManeuver") publish() } is TripState.Idle -> { @@ -418,12 +423,25 @@ internal class NavigationRuntime private constructor(private val context: Contex runCatching { engine?.close() }; engine = null recovery.roadFailed(); speech?.flush() fields["status"] = "error"; fields["problem"] = "route-not-started"; fields["canRetry"] = true - fields.remove("route"); fields.remove("routeRevision") + fields.remove("route"); fields.remove("routeRevision"); clearGuidance() publish() } } } + /** Structured maneuvers and progress for the interface; ids belong to the installed route revision. */ + private fun publishGuidance(remainingSteps: Int, snapped: uniffi.ferrostar.GeographicCoordinate?, alignment: String) { + val active = engine ?: return + clearGuidance() + try { + fields.putAll(GuidanceFields.build(routeSequence, active.index, active.route.steps, active.facts, remainingSteps, snapped, alignment)) + } catch (error: RuntimeException) { + // Presentation data must never stop guidance; the text instructions remain. + Log.w(TAG, "guidance fields failed ${error.javaClass.name}") + } + } + private fun clearGuidance() { GUIDANCE_KEYS.forEach { fields.remove(it) } } + private fun arrive(instruction: String, routeEnd: Point?) { val destinationDistance = routeEnd?.let { end -> target?.let { selected -> FloatArray(1).also { Location.distanceBetween(end.latitude, end.longitude, selected.latitude, selected.longitude, it) }[0].toDouble() @@ -514,6 +532,7 @@ internal class NavigationRuntime private constructor(private val context: Contex engine?.close(); engine = next; spoken.clear(); deviation.reset() Log.i(TAG, "route installed fresh=$fresh steps=${next.route.steps.size}") fields["routeRevision"] = ++routeSequence + clearGuidance() fields["route"] = mapOf("geometry" to next.route.geometry.map { Point(it.lat, it.lng).bridge() }, "source" to "FOSSGIS / OpenStreetMap", "fetchedAt" to response.fetchedAt) if (!fresh) { @@ -581,9 +600,18 @@ internal class NavigationRuntime private constructor(private val context: Contex private fun fixMap(fix: Location): Map = mutableMapOf("latitude" to fix.latitude, "longitude" to fix.longitude, "accuracyMeters" to fix.accuracy.toDouble(), "timestamp" to fix.time).apply { if (fix.hasBearing() && fix.bearing.isFinite() && fix.hasSpeed() && fix.speed.isFinite() && fix.speed >= 1f) put("bearing", fix.bearing.toDouble()) + val modern = Build.VERSION.SDK_INT >= 26 + putAll(FixKinematics.fields( + speed = if (fix.hasSpeed()) fix.speed else null, + speedAccuracy = if (modern && fix.hasSpeedAccuracy()) fix.speedAccuracyMetersPerSecond else null, + course = if (fix.hasBearing()) fix.bearing else null, + courseAccuracy = if (modern && fix.hasBearingAccuracy()) fix.bearingAccuracyDegrees else null, + elapsedRealtimeNanos = fix.elapsedRealtimeNanos, + )) } companion object { const val TAG = "AvoidNav" + private val GUIDANCE_KEYS = listOf("upcomingManeuver", "followingManeuver", "routeProgress", "snappedLocation", "alignment") private val LOCATION_PROBLEMS = setOf("location-permission", "location-disabled", "location-stale", "location-inaccurate", "location-unavailable") @Volatile private var instance: NavigationRuntime? = null fun get(context: Context): NavigationRuntime = instance ?: synchronized(this) { diff --git a/modules/avoid-navigation/android/src/test/java/quest/avoid/maps/navigation/GuidanceModelTest.kt b/modules/avoid-navigation/android/src/test/java/quest/avoid/maps/navigation/GuidanceModelTest.kt new file mode 100644 index 0000000..e0d3629 --- /dev/null +++ b/modules/avoid-navigation/android/src/test/java/quest/avoid/maps/navigation/GuidanceModelTest.kt @@ -0,0 +1,194 @@ +package quest.avoid.maps.navigation + +import kotlin.math.cos +import kotlin.math.sin +import org.json.JSONArray +import org.json.JSONObject +import org.junit.Assert.* +import org.junit.Test +import uniffi.ferrostar.BoundingBox +import uniffi.ferrostar.GeographicCoordinate +import uniffi.ferrostar.Route +import uniffi.ferrostar.RouteStep + +/** + * Deterministic route fixtures for the structured guidance snapshot: straight, left/right turns, + * close turns, roundabout, U-turn, arrival, deviation and degraded fix kinematics. + */ +class GuidanceModelTest { + private val origin = GeographicCoordinate(45.0703, 7.6869) + + /** Point [meters] from [from] along compass [bearing]. */ + private fun move(from: GeographicCoordinate, bearing: Double, meters: Double): GeographicCoordinate { + val radians = Math.toRadians(bearing) + val lat = from.lat + meters * cos(radians) / 111_195.0 + val lng = from.lng + meters * sin(radians) / (111_195.0 * cos(Math.toRadians(from.lat))) + return GeographicCoordinate(lat, lng) + } + + /** Legs of (bearing, metres) walked in 10 m points; returns the polyline and each leg's slice. */ + private fun polyline(legs: List>): Pair, List>> { + val points = mutableListOf(origin) + val slices = mutableListOf>() + for ((bearing, meters) in legs) { + val start = points.size - 1 + val count = maxOf(1, (meters / 10).toInt()) + repeat(count) { points.add(move(points.last(), bearing, meters / count)) } + slices.add(points.subList(start, points.size).toList()) + } + return points to slices + } + + private fun rawStep(type: String, at: GeographicCoordinate, modifier: String? = null, name: String = "", exit: Int? = null, + before: Int? = null, after: Int? = null): JSONObject { + val maneuver = JSONObject().put("type", type).put("location", JSONArray().put(at.lng).put(at.lat)) + modifier?.let { maneuver.put("modifier", it) } + exit?.let { maneuver.put("exit", it) } + before?.let { maneuver.put("bearing_before", it) } + after?.let { maneuver.put("bearing_after", it) } + return JSONObject().put("name", name).put("maneuver", maneuver).put("driving_side", "right") + } + + private class Fixture(val route: Route, val facts: List) { + val index = RouteGuideIndex(route.geometry, route.steps, facts) + fun fields(remaining: Int, snapped: GeographicCoordinate?, alignment: String = Alignment.ALIGNED, revision: Long = 7) = + GuidanceFields.build(revision, index, route.steps, facts, remaining, snapped, alignment) + } + + /** One step per leg plus the arrival; raw[k] describes step k's maneuver. */ + private fun fixture(legs: List>, raw: (Int, GeographicCoordinate) -> JSONObject): Fixture { + val (points, slices) = polyline(legs) + val steps = slices.mapIndexed { k, slice -> + val length = slice.zipWithNext { a, b -> RouteGuideIndex.distance(a, b) }.sum() + RouteStep(slice, length, length / 1.4, null, emptyList(), "Passo $k", emptyList(), emptyList(), null, emptyList(), null, null) + } + RouteStep(listOf(points.last(), points.last()), 0.0, 0.0, null, emptyList(), "Arrivo", emptyList(), emptyList(), null, emptyList(), null, null) + val json = JSONObject().put("code", "Ok").put("routes", JSONArray().put(JSONObject().put("legs", JSONArray().put( + JSONObject().put("steps", JSONArray(steps.indices.map { k -> raw(k, steps[k].geometry.first()) })), + )))).toString() + val route = Route(points, BoundingBox(points.first(), points.last()), steps.sumOf { it.distance }, emptyList(), steps) + return Fixture(route, ManeuverFacts.parse(json)) + } + + @Test fun straightRouteProgressIsMonotonicAndMatchesRenderedGeometry() { + val f = fixture(listOf(0.0 to 300.0)) { k, at -> if (k == 0) rawStep("depart", at) else rawStep("arrive", at) } + assertEquals(300.0, f.index.length, 0.5) + var previous = -1.0 + for (meters in listOf(0.0, 15.0, 100.0, 222.0, 299.0)) { + val traveled = f.index.progress(0, move(origin, 0.0, meters)).traveledMeters + assertEquals(meters, traveled, 0.5) + assertTrue(traveled > previous); previous = traveled + } + // A sidewalk offset of 8 m does not change the along-route progress. + assertEquals(100.0, f.index.progress(0, move(move(origin, 0.0, 100.0), 90.0, 8.0)).traveledMeters, 0.5) + val fields = f.fields(remaining = 2, snapped = move(origin, 0.0, 50.0)) + @Suppress("UNCHECKED_CAST") val upcoming = fields["upcomingManeuver"] as Map + assertEquals("arrive", upcoming["type"]); assertEquals("7:1", upcoming["id"]) + assertNull(fields["followingManeuver"]) + @Suppress("UNCHECKED_CAST") val progress = fields["routeProgress"] as Map + assertEquals(50.0, progress["traveledMeters"] as Double, 0.5) + assertEquals(300.0, progress["routeLengthMeters"] as Double, 0.5) + } + + @Test fun leftAndRightTurnsExposeTypedUpcomingAndFollowingWithStableIds() { + val f = fixture(listOf(0.0 to 200.0, 90.0 to 150.0, 0.0 to 100.0)) { k, at -> when (k) { + 0 -> rawStep("depart", at, name = "Via Po", after = 0) + 1 -> rawStep("turn", at, "right", "Via Roma", before = 0, after = 90) + 2 -> rawStep("turn", at, "left", "Via Garibaldi", before = 90, after = 0) + else -> rawStep("arrive", at) + } } + assertArrayEquals(intArrayOf(0, 20, 35, 45), f.index.maneuverIndex) + val fields = f.fields(remaining = 4, snapped = move(origin, 0.0, 120.0)) + @Suppress("UNCHECKED_CAST") val upcoming = fields["upcomingManeuver"] as Map + @Suppress("UNCHECKED_CAST") val following = fields["followingManeuver"] as Map + assertEquals(listOf("7:1", "turn", "right", "Via Roma", 20, 0, 90, "right"), + listOf(upcoming["id"], upcoming["type"], upcoming["modifier"], upcoming["name"], upcoming["geometryIndex"], upcoming["bearingBefore"], upcoming["bearingAfter"], upcoming["drivingSide"])) + assertEquals(listOf("7:2", "left", 35), listOf(following["id"], following["modifier"], following["geometryIndex"])) + // The following maneuver is a whole upcoming step away: 150 m, about 107 s on foot. + assertEquals(150.0, following["afterUpcomingMeters"] as Double, 0.5) + assertEquals(107.1, following["afterUpcomingSeconds"] as Double, 0.5) + // A reroute changes every id even for the same step index. + @Suppress("UNCHECKED_CAST") + assertEquals("8:1", (f.fields(4, null, revision = 8)["upcomingManeuver"] as Map)["id"]) + // Ferrostar advanced past the first turn: the left turn is next and progress continues. + val after = f.fields(remaining = 3, snapped = move(move(origin, 0.0, 200.0), 90.0, 40.0)) + @Suppress("UNCHECKED_CAST") assertEquals("7:2", (after["upcomingManeuver"] as Map)["id"]) + @Suppress("UNCHECKED_CAST") assertEquals(240.0, (after["routeProgress"] as Map)["traveledMeters"] as Double, 0.6) + } + + @Test fun closeTurnsReportTheShortGapBetweenManeuvers() { + val f = fixture(listOf(0.0 to 200.0, 90.0 to 20.0, 0.0 to 120.0)) { k, at -> when (k) { + 0 -> rawStep("depart", at); 1 -> rawStep("turn", at, "right"); 2 -> rawStep("turn", at, "left"); else -> rawStep("arrive", at) + } } + @Suppress("UNCHECKED_CAST") val following = f.fields(4, move(origin, 0.0, 150.0))["followingManeuver"] as Map + assertEquals(20.0, following["afterUpcomingMeters"] as Double, 0.5) + assertEquals("left", following["modifier"]) + } + + @Test fun roundaboutKeepsExitNumberModifierAndDrivingSide() { + val f = fixture(listOf(0.0 to 120.0, 45.0 to 60.0, 90.0 to 100.0)) { k, at -> when (k) { + 0 -> rawStep("depart", at); 1 -> rawStep("roundabout", at, "right", "Corso Francia", exit = 3) + 2 -> rawStep("exit roundabout", at, "right", "Corso Francia"); else -> rawStep("arrive", at) + } } + @Suppress("UNCHECKED_CAST") val upcoming = f.fields(4, move(origin, 0.0, 60.0))["upcomingManeuver"] as Map + assertEquals(listOf("roundabout", "right", 3, "right"), listOf(upcoming["type"], upcoming["modifier"], upcoming["exit"], upcoming["drivingSide"])) + } + + @Test fun uTurnSearchesForwardAndProgressNeverJumpsToTheOutboundLeg() { + // North 100 m, U-turn back south 100 m over the same line, then east 80 m. + val f = fixture(listOf(0.0 to 100.0, 180.0 to 100.0, 90.0 to 80.0)) { k, at -> when (k) { + 0 -> rawStep("depart", at); 1 -> rawStep("continue", at, "uturn"); 2 -> rawStep("turn", at, "left"); else -> rawStep("arrive", at) + } } + assertArrayEquals(intArrayOf(0, 10, 20, 28), f.index.maneuverIndex) + // Returning past the 70 m mark: on step 1 the projection stays on the return leg (130 m traveled). + assertEquals(130.0, f.index.progress(1, move(origin, 0.0, 70.0)).traveledMeters, 0.6) + assertEquals(70.0, f.index.progress(0, move(origin, 0.0, 70.0)).traveledMeters, 0.6) + @Suppress("UNCHECKED_CAST") val upcoming = f.fields(4, move(origin, 0.0, 50.0))["upcomingManeuver"] as Map + assertEquals("continue" to "uturn", upcoming["type"] to upcoming["modifier"]) + } + + @Test fun arrivalHasNoFollowingManeuverAndUnknownTypesStayUnguessed() { + val f = fixture(listOf(0.0 to 80.0)) { k, at -> if (k == 0) rawStep("depart", at) else rawStep("future-type", at, "sideways") } + val fields = f.fields(remaining = 2, snapped = move(origin, 0.0, 79.0)) + @Suppress("UNCHECKED_CAST") val upcoming = fields["upcomingManeuver"] as Map + assertEquals("future-type", upcoming["type"]) + assertFalse("an unknown modifier is dropped, never guessed", upcoming.containsKey("modifier")) + assertFalse(fields.containsKey("followingManeuver")) + // Ferrostar on the last step: nothing upcoming, progress still published. + val last = f.fields(remaining = 1, snapped = move(origin, 0.0, 80.0)) + assertFalse(last.containsKey("upcomingManeuver")) + assertTrue(last.containsKey("routeProgress")) + } + + @Test fun alignmentFollowsDeviationOnlyForJudgedFixes() { + assertEquals(Alignment.ALIGNED, Alignment.of(judged = true, offRoute = false, deviation = false)) + assertEquals(Alignment.DEVIATING, Alignment.of(judged = true, offRoute = false, deviation = true)) + assertEquals(Alignment.DEVIATING, Alignment.of(judged = false, offRoute = true, deviation = false)) + // A coarse fix neither declares nor clears deviation: the snapped position is not credible. + assertEquals(Alignment.UNKNOWN, Alignment.of(judged = false, offRoute = false, deviation = true)) + val f = fixture(listOf(0.0 to 80.0)) { k, at -> rawStep(if (k == 0) "depart" else "arrive", at) } + assertEquals(Alignment.UNKNOWN, f.fields(2, null, Alignment.UNKNOWN)["alignment"]) + assertFalse(f.fields(2, null).containsKey("snappedLocation")) + } + + @Test fun degradedKinematicsAreOmittedAndCourseWrapsIntoOneTurn() { + val clean = FixKinematics.fields(1.4f, 0.3f, 359.6f, 12f, 5_000_000_000L) + assertEquals(mapOf("speedMps" to 1.4, "speedAccuracyMps" to 0.3, "course" to 359.6, "courseAccuracyDegrees" to 12.0, "elapsedMs" to 5_000L), clean) + assertEquals(0.0, FixKinematics.fields(null, null, 360f, null, 1L)["course"]) + assertEquals(0.0, FixKinematics.fields(null, null, 359.97f, null, 1L)["course"]) + assertEquals(350.0, FixKinematics.fields(null, null, -10f, null, 1L)["course"]) + // NaN, negative speed and missing monotonic time never reach the bridge. + assertEquals(emptyMap(), FixKinematics.fields(Float.NaN, -1f, Float.POSITIVE_INFINITY, Float.NaN, 0L)) + val values = FixKinematics.fields(-0.5f, Float.NaN, 10f, -3f, 2_000_000L).values + assertTrue(values.all { (it as? Double)?.isFinite() ?: true }) + } + + @Test fun factsParseEveryLegInOrderAndBoundText() { + fun leg(name: String) = JSONObject().put("steps", JSONArray().put(rawStep("depart", origin, name = name)).put(rawStep("arrive", origin))) + val json = JSONObject().put("code", "Ok").put("routes", JSONArray().put(JSONObject().put("legs", JSONArray().put(leg("Via Po")).put(leg("x".repeat(400)))))) + val facts = ManeuverFacts.parse(json.toString()) + assertEquals(listOf("depart", "arrive", "depart", "arrive"), facts.map { it.type }) + assertEquals("Via Po", facts[0].name) + assertEquals(160, facts[2].name?.length) + assertEquals(origin.lat, facts[0].latitude, 1e-9) + } +} diff --git a/src/domain/navigation.ts b/src/domain/navigation.ts index b53d2af..89449e4 100644 --- a/src/domain/navigation.ts +++ b/src/domain/navigation.ts @@ -19,7 +19,7 @@ export interface NavigationSnapshot { notificationGranted: boolean; /** Independent of retained route/admission errors: only a current accepted fix is usable. */ locationUsable?: boolean; - location?: Coordinate & { accuracyMeters: number; bearing?: number; timestamp: number }; + location?: NavigationFix; instruction?: string; nextInstruction?: string; distanceToManeuverMeters?: number; @@ -27,6 +27,15 @@ export interface NavigationSnapshot { durationRemainingSeconds?: number; destinationDistanceMeters?: number; routeRevision?: number; + /** The next maneuver (Ferrostar's remainingSteps[1]); `instruction` is its Italian text. */ + upcomingManeuver?: GuidanceManeuver; + /** The maneuver after it (`nextInstruction`), with the distance/time separating the two. */ + followingManeuver?: FollowingManeuver; + /** Snapped progress measured on the bridged route geometry, for the traveled/remaining split. */ + routeProgress?: RouteProgress; + /** Ferrostar's route-snapped position; credible only while `alignment` is `aligned`. */ + snappedLocation?: Coordinate; + alignment?: 'aligned' | 'deviating' | 'unknown'; /** Events omit an unchanged route; null or a terminal session clears it. Reads include the full route. */ route?: { geometry: Coordinate[]; source: string; fetchedAt: number } | null; problem?: 'location-permission' | 'location-disabled' | 'location-stale' | 'location-inaccurate' | 'location-unavailable' @@ -58,6 +67,52 @@ export interface NavigationSnapshot { }; canRetry: boolean; } +/** An accepted fix. Kinematics are present only when the platform supplied finite values. */ +export interface NavigationFix extends Coordinate { + accuracyMeters: number; + /** Course while moving at 1 m/s or more (legacy field kept for older consumers). */ + bearing?: number; + /** Wall-clock sample time (ms). */ + timestamp: number; + speedMps?: number; + speedAccuracyMps?: number; + /** Course over ground in [0, 360), with its 68% accuracy when the platform reports one. */ + course?: number; + courseAccuracyDegrees?: number; + /** Monotonic sample time (Android elapsed realtime, ms): intervals, never wall time. */ + elapsedMs?: number; +} +export type ManeuverModifier = 'uturn' | 'sharp right' | 'right' | 'slight right' | 'straight' | 'slight left' | 'left' | 'sharp left'; +/** Raw OSRM maneuver facts; `id` is stable for one route revision and changes on every reroute. */ +export interface GuidanceManeuver { + id: string; + stepIndex: number; + /** Index of the maneuver point in the immutable route geometry of the same revision. */ + geometryIndex: number; + /** OSRM maneuver type, passed through unchanged; unknown values must not be guessed into turns. */ + type: string; + modifier?: ManeuverModifier; + exit?: number; + name?: string; + ref?: string; + instruction: string; + latitude?: number; + longitude?: number; + bearingBefore?: number; + bearingAfter?: number; + drivingSide?: 'left' | 'right'; +} +export interface FollowingManeuver extends GuidanceManeuver { + afterUpcomingMeters: number; + afterUpcomingSeconds: number; +} +export interface RouteProgress { + traveledMeters: number; + routeLengthMeters: number; + /** Route-geometry segment holding the snapped position. */ + segmentIndex: number; + stepIndex: number; +} export interface NavigationStart { destination: Coordinate; mode: RoadMode } export interface TransitNavigationStart { plan: RoutePlan; origin: Coordinate; destination: Coordinate } export type TransitConfirmation = 'board' | 'alight' | 'walk-complete'; diff --git a/src/features/navigation/guidance-camera.test.ts b/src/features/navigation/guidance-camera.test.ts new file mode 100644 index 0000000..961b6e1 --- /dev/null +++ b/src/features/navigation/guidance-camera.test.ts @@ -0,0 +1,179 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { CAMERA_PROFILES, followsClosely, framesManeuver, GuidanceCamera, nextIntent, overviewBounds, type CameraFrame, type CameraInput } from './guidance-camera'; +import { maneuverPoint, PHONE, routeFixture, trajectory, TURIN } from './guidance-fixtures'; +import { inside, paddingForAnchor, principalPoint, project } from './map-projection'; +import { angleDelta, distanceMeters, offsetCoordinate, offsetOfIndex } from './route-measure'; + +const run = (inputs: CameraInput[]) => { const camera = new GuidanceCamera(); return inputs.map(input => camera.update(input)!); }; +const rect = { left: 16, right: PHONE.width - 16, top: PHONE.top + 12, bottom: PHONE.bottom - 12 }; +const size = { width: PHONE.width, height: PHONE.height }; +const anchorOf = (frame: CameraFrame) => project(frame, size, frame.center)!; + +test('padding draws the camera centre at a low anchor under pitch; bottom padding alone would move it up', () => { + for (const pitch of [0, 30, 48]) { + const padding = paddingForAnchor(size, 0.72 * PHONE.height); + const point = project({ center: TURIN, zoom: 17, bearing: 33, pitch, padding }, size, TURIN)!; + assert.ok(Math.abs(point.y - 0.72 * PHONE.height) < 0.01 && Math.abs(point.x - PHONE.width / 2) < 0.01); + const ahead = project({ center: TURIN, zoom: 17, bearing: 0, pitch, padding }, size, offsetCoordinate(TURIN, 0, 50))!; + assert.ok(ahead.y < point.y, 'a point ahead is drawn above the puck'); + } + assert.ok(principalPoint(size, { top: 0, right: 0, bottom: 200, left: 0 }).y < PHONE.height / 2, 'bottom padding raises the centre'); +}); + +test('straight cruise: course-up, steady zoom and the puck on its mode anchor', () => { + const fixture = routeFixture([{ bearing: 20, meters: 900 }]); + for (const [mode, speed] of [['walk', 1.4], ['bicycle', 5], ['car', 12]] as const) { + const frames = run(trajectory(fixture, { mode, speed, seconds: 25 })); + const steady = frames.slice(5); + const profile = CAMERA_PROFILES[mode]; + const target = PHONE.top + profile.anchor * (PHONE.bottom - PHONE.top); + for (const frame of steady) { + assert.ok(Math.abs(angleDelta(frame.bearing, 20)) < 1, `${mode} bearing ${frame.bearing}`); + assert.equal(frame.pitch, profile.pitch); + // ±3% of the unobscured height: here exact, the camera centre is the puck. + assert.ok(Math.abs(anchorOf(frame).y - target) / (PHONE.bottom - PHONE.top) < 0.03); + assert.equal(frame.puck.kind, 'wedge'); + assert.equal(frame.easing, 'linear'); + } + assert.ok(Math.max(...steady.map(f => f.zoom)) - Math.min(...steady.map(f => f.zoom)) < 0.01, `${mode} zoom steady`); + // Lead: none walking; at most one interval (speed × 1 s) for bicycle/car. + for (const frame of steady) assert.ok(frame.leadMeters <= (mode === 'walk' ? 0 : speed + 0.01)); + } +}); + +test('bearing across 359°→1° takes the short way and never orbits', () => { + const fixture = routeFixture([{ bearing: 0, meters: 600 }]); + const courses = [350, 353, 356, 359, 1, 3, 6, 2, 358, 355]; + const frames = run(trajectory(fixture, { mode: 'car', speed: 10, seconds: courses.length, alignment: 'deviating', course: t => courses[t] })); + for (let i = 1; i < frames.length; i += 1) assert.ok(Math.abs(angleDelta(frames[i - 1]!.bearing, frames[i]!.bearing)) < 8); + for (const frame of frames) assert.ok(Math.abs(angleDelta(frame.bearing, 0)) <= 12, `bearing ${frame.bearing}`); +}); + +test('30 s stationary with noisy courses: no orbiting and no zoom pumping', () => { + const fixture = routeFixture([{ bearing: 75, meters: 400 }]); + let seed = 7; + const noise = () => { seed = (seed * 1103515245 + 12345) % 2 ** 31; return seed / 2 ** 31; }; + const inputs = trajectory(fixture, { mode: 'car', speed: 10, seconds: 36, speedAt: t => t < 6 ? 10 : 0.2 * noise(), course: (_, route) => _ < 6 ? route : noise() * 360 }); + // Stopped fixes jitter around one point. + for (const input of inputs.slice(6)) Object.assign(input.fix!, offsetCoordinate(inputs[6]!.fix!, noise() * 360, noise() * 4)); + const frames = run(inputs).slice(7); + assert.ok(frames.every(frame => Math.abs(angleDelta(frames[0]!.bearing, frame.bearing)) < 0.01), 'bearing held'); + assert.ok(Math.max(...frames.map(f => f.zoom)) - Math.min(...frames.map(f => f.zoom)) < 0.06, 'zoom held'); + assert.ok(frames.every(frame => frame.leadMeters === 0), 'no extrapolation while stopped'); +}); + +for (const [mode, speed, window] of [['walk', 1.4, 8], ['bicycle', 5, 10], ['car', 10, 12]] as const) { + test(`${mode}: turn framing starts ${window} s before the turn and shows the junction and outgoing path`, () => { + const fixture = routeFixture([{ bearing: 0, meters: 400 }, { bearing: 90, meters: 300, modifier: 'right' }]); + const inputs = trajectory(fixture, { mode, speed, seconds: Math.ceil(520 / speed) }); + const frames = run(inputs); + const turn = offsetOfIndex(fixture.route, fixture.maneuvers[1]!.geometryIndex); + const first = frames.findIndex(frame => frame.framing?.maneuverId === '1:1'); + assert.ok(first > 0); + const secondsBefore = (turn - inputs[first]!.progress!.traveledMeters) / speed; + assert.ok(secondsBefore <= window + 0.01 && secondsBefore > window - 1 - 0.01, `${mode} framing began ${secondsBefore.toFixed(1)} s before`); + // Once the zoom has settled, the junction and outgoing path are inside the unobscured map. + const framed = frames.slice(first + 2).filter(frame => frame.framing?.maneuverId === '1:1'); + assert.ok(framed.length > 0); + for (const frame of framed) for (const point of frame.framing!.points) assert.ok(inside(project(frame, size, point), rect), `${mode} framed point outside`); + // After the turn: the zoom returns to cruise over 2–3 s, not in one jump. + const after = frames.findIndex((frame, i) => i > first && frame.framing === null); + const cruise = frames[first - 1]!.zoom; + const back = frames.findIndex((frame, i) => i >= after && Math.abs(frame.zoom - cruise) < 0.05); + if (frames[after]!.zoom < cruise - 0.3) assert.ok(back - after >= 2 && back - after <= 4, `${mode} release ${back - after} s`); + }); +} + +test('close turns: both junctions are framed', () => { + const fixture = routeFixture([{ bearing: 0, meters: 300 }, { bearing: 90, meters: 25, modifier: 'right' }, { bearing: 0, meters: 200, modifier: 'left' }]); + const frames = run(trajectory(fixture, { mode: 'car', speed: 9, seconds: 32 })); + const framed = frames.filter(frame => frame.framing?.maneuverId === '1:1'); + assert.ok(framed.length > 0); + const second = maneuverPoint(fixture.maneuvers[2]!); + for (const frame of framed.slice(2)) { + assert.ok(frame.framing!.points.some(point => distanceMeters(point, second) < 1), 'second junction included'); + for (const point of frame.framing!.points) assert.ok(inside(project(frame, size, point), rect)); + } +}); + +test('roundabouts and U-turns are framed; arrival and straight continuations are not', () => { + assert.ok(framesManeuver({ id: 'a', stepIndex: 1, geometryIndex: 1, type: 'roundabout', exit: 2, modifier: 'right', instruction: '' })); + assert.ok(framesManeuver({ id: 'a', stepIndex: 1, geometryIndex: 1, type: 'continue', modifier: 'uturn', instruction: '' })); + assert.ok(!framesManeuver({ id: 'a', stepIndex: 1, geometryIndex: 1, type: 'arrive', instruction: '' })); + assert.ok(!framesManeuver({ id: 'a', stepIndex: 1, geometryIndex: 1, type: 'new name', modifier: 'straight', instruction: '' })); +}); + +test('U-turn: the presentation lead never passes the unconfirmed maneuver', () => { + const fixture = routeFixture([{ bearing: 0, meters: 200 }, { bearing: 180, meters: 200, type: 'continue', modifier: 'uturn' }]); + const inputs = trajectory(fixture, { mode: 'car', speed: 12, seconds: 18 }); + const frames = run(inputs); + const turn = offsetOfIndex(fixture.route, fixture.maneuvers[1]!.geometryIndex); + frames.forEach((frame, i) => { + const traveled = inputs[i]!.progress!.traveledMeters; + if (traveled < turn) assert.ok(traveled + frame.leadMeters <= turn - 3 + 0.01 || frame.leadMeters === 0); + }); +}); + +test('deviation: cycling/driving leave the snapped line; walking always keeps its real offset', () => { + const fixture = routeFixture([{ bearing: 0, meters: 500 }]); + const offRoute = run(trajectory(fixture, { mode: 'car', speed: 10, seconds: 4, lateralMeters: 12, alignment: 'deviating' })); + const aligned = run(trajectory(fixture, { mode: 'car', speed: 10, seconds: 4, lateralMeters: 12 })); + const walking = run(trajectory(fixture, { mode: 'walk', speed: 1.4, seconds: 4, lateralMeters: 6 })); + const inputs = trajectory(fixture, { mode: 'car', speed: 10, seconds: 4, lateralMeters: 12 }); + assert.ok(distanceMeters(offRoute[3]!.puck.coordinate, inputs[3]!.fix!) < 0.01); + assert.ok(distanceMeters(aligned[3]!.puck.coordinate, inputs[3]!.snapped!) < 0.01); + const walkInputs = trajectory(fixture, { mode: 'walk', speed: 1.4, seconds: 4, lateralMeters: 6 }); + assert.ok(distanceMeters(walking[3]!.puck.coordinate, walkInputs[3]!.fix!) < 0.01); +}); + +test('degraded fixes stop extrapolation, hold the camera and show a retained puck', () => { + const fixture = routeFixture([{ bearing: 0, meters: 800 }]); + const inputs = trajectory(fixture, { mode: 'car', speed: 12, seconds: 8 }); + const camera = new GuidanceCamera(); + const frames = inputs.slice(0, 5).map(input => camera.update(input)!); + const live = frames[4]!; + assert.ok(live.leadMeters > 0); + // The same retained fix, now unusable: no camera move, puck subdued at the accepted position. + const degraded = camera.update({ ...inputs[4]!, usable: false })!; + assert.equal(degraded.key, live.key); + assert.equal(degraded.puck.kind, 'retained'); + assert.ok(distanceMeters(degraded.puck.coordinate, inputs[4]!.fix!) < 0.01); + // A late fix after the gap eases in without any lead. + const late = camera.update({ ...inputs[7]!, fix: { ...inputs[7]!.fix!, elapsedMs: inputs[4]!.fix!.elapsedMs! + 9000 } })!; + assert.equal(late.leadMeters, 0); + assert.equal(late.easing, 'ease'); +}); + +test('duplicate timestamps return the same frame; arrival is not framed', () => { + const fixture = routeFixture([{ bearing: 0, meters: 120 }]); + const inputs = trajectory(fixture, { mode: 'walk', speed: 1.4, seconds: 6, startOffset: 110 }); + const camera = new GuidanceCamera(); + const first = camera.update(inputs[0]!); + assert.equal(camera.update({ ...inputs[0]!, fix: { ...inputs[0]!.fix!, latitude: inputs[0]!.fix!.latitude + 0.0001 } }), first); + for (const input of inputs) assert.equal(camera.update(input)!.framing, null); +}); + +test('intent: a gesture enters free, overview and recenter are explicit; recenter is one ~500 ms move', () => { + assert.equal(nextIntent('follow', 'gesture'), 'free'); + assert.equal(nextIntent('overview', 'gesture'), 'free'); + assert.equal(nextIntent('free', 'overview'), 'overview'); + assert.equal(nextIntent('free', 'recenter'), 'follow'); + const fixture = routeFixture([{ bearing: 0, meters: 300 }]); + const camera = new GuidanceCamera(); + const frame = camera.update(trajectory(fixture, { mode: 'walk', speed: 1.4, seconds: 1 })[0]!)!; + const recenter = camera.recenter()!; + assert.notEqual(recenter.key, frame.key); + assert.equal(recenter.durationMs, 500); + assert.deepEqual([recenter.bearing, recenter.pitch, recenter.zoom], [frame.bearing, frame.pitch, frame.zoom]); + const bounds = overviewBounds(fixture.route, 100, TURIN)!; + assert.ok(bounds[0] < bounds[2] && bounds[1] < bounds[3]); +}); + +test('"Poi" appears only when the following maneuver is within about ten seconds of travel', () => { + const near = { id: '1:2', stepIndex: 2, geometryIndex: 4, type: 'turn', instruction: '', afterUpcomingMeters: 25, afterUpcomingSeconds: 18 }; + assert.ok(followsClosely(near, 9), 'by distance at driving speed'); + assert.ok(!followsClosely({ ...near, afterUpcomingMeters: 400, afterUpcomingSeconds: 40 }, 9)); + assert.ok(followsClosely({ ...near, afterUpcomingMeters: 400, afterUpcomingSeconds: 8 }, 9), 'by route time'); + assert.ok(!followsClosely(undefined, 9)); +}); diff --git a/src/features/navigation/guidance-camera.ts b/src/features/navigation/guidance-camera.ts new file mode 100644 index 0000000..49d513d --- /dev/null +++ b/src/features/navigation/guidance-camera.ts @@ -0,0 +1,318 @@ +import type { Coordinate } from '../../domain/types'; +import type { FollowingManeuver, GuidanceManeuver, NavigationFix, RouteProgress } from '../../domain/navigation'; +import { inside, paddingForAnchor, project, type CameraPose, type Padding, type ScreenPoint, type VisibleRect } from './map-projection'; +import { angleDelta, distanceMeters, normalizeBearing, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, sliceRoute, type RouteMeasure } from './route-measure'; + +export type CameraMode = 'walk' | 'bicycle' | 'car'; + +/** + * Per-mode first-person camera. Values are starting points tuned by replay; see + * docs/development/navigation.md. Zoom is MapLibre zoom (512 px tiles), pitch in degrees, anchor + * is the puck's position as a fraction of the unobscured map height (between banner and strip). + */ +export interface CameraProfile { + pitch: number; + /** Cruise zoom for a smoothed speed (m/s). */ + cruiseZoom: (speed: number) => number; + /** Lowest zoom turn framing may reach. */ + minZoom: number; + anchor: number; + /** Turn framing starts this many seconds before the maneuver. */ + anticipationSeconds: number; + /** Outgoing path framed after the junction (metres). */ + outgoingMeters: number; + /** Below this speed a GPS course is not trusted (m/s). */ + courseSpeed: number; + /** Below this speed the camera holds its bearing (stopped at lights, waiting to cross). */ + holdSpeed: number; + /** Speed used to judge "within N seconds" when the fix reports none. */ + typicalSpeed: number; + /** Presentation-only lead along the route, bounded to one fix interval. */ + extrapolate: boolean; + /** Aim at Ferrostar's snapped position while alignment is credible. */ + snapToRoute: boolean; + routeLookAhead: number; + /** Bearing smoothing per fix (0..1) and dead band (degrees). */ + bearingGain: number; + bearingDeadBand: number; +} + +const lerp = (a: number, b: number, t: number) => a + (b - a) * Math.min(1, Math.max(0, t)); +export const CAMERA_PROFILES: Record = { + walk: { + pitch: 30, cruiseZoom: () => 18.1, minZoom: 16.9, anchor: 0.67, anticipationSeconds: 8, outgoingMeters: 30, + courseSpeed: 0.8, holdSpeed: 0.35, typicalSpeed: 1.3, extrapolate: false, snapToRoute: false, routeLookAhead: 12, + bearingGain: 0.45, bearingDeadBand: 4, + }, + bicycle: { + pitch: 42, cruiseZoom: speed => lerp(18, 17.1, (speed - 3) / 5), minZoom: 16.6, anchor: 0.715, anticipationSeconds: 10, + outgoingMeters: 45, courseSpeed: 1.6, holdSpeed: 0.8, typicalSpeed: 4.5, extrapolate: true, snapToRoute: true, + routeLookAhead: 20, bearingGain: 0.55, bearingDeadBand: 3, + }, + car: { + pitch: 48, cruiseZoom: speed => lerp(17.7, 15.7, (speed - 6) / 19), minZoom: 15.4, anchor: 0.735, anticipationSeconds: 12, + outgoingMeters: 70, courseSpeed: 2.5, holdSpeed: 1.2, typicalSpeed: 9, extrapolate: true, snapToRoute: true, + routeLookAhead: 30, bearingGain: 0.6, bearingDeadBand: 2.5, + }, +}; + +/** The unobscured map: between the bottom of the maneuver banner and the top of the bottom strip. */ +export interface GuidanceViewport { width: number; height: number; top: number; bottom: number } + +export interface CameraInput { + mode: CameraMode; + fix?: NavigationFix; + /** A current accepted fix (not degraded, stale or paused). */ + usable: boolean; + route: RouteMeasure | null; + routeRevision?: number; + progress?: RouteProgress; + alignment?: 'aligned' | 'deviating' | 'unknown'; + snapped?: Coordinate; + upcoming?: GuidanceManeuver; + following?: FollowingManeuver; + distanceToManeuverMeters?: number; + viewport: GuidanceViewport; + /** Transit walks: walking camera on the supplied trace, never turn framing. */ + traceOnly?: boolean; +} + +export type PuckKind = 'wedge' | 'dot' | 'retained'; +export interface CameraFrame { + /** Identity of the fix this frame answers; equal keys mean "no new move". */ + key: string; + center: Coordinate; + bearing: number; + pitch: number; + zoom: number; + padding: Padding; + durationMs: number; + easing: 'linear' | 'ease'; + /** Screen point where the camera centre (and the follow puck) is drawn. */ + anchor: ScreenPoint; + puck: { coordinate: Coordinate; heading: number | null; kind: PuckKind }; + /** Junction + outgoing points the frame must show, for screen assertions. */ + framing: { maneuverId: string; points: Coordinate[] } | null; + /** Lead added ahead of the accepted fix (presentation only, metres). */ + leadMeters: number; +} + +const median = (values: number[]) => { const sorted = [...values].sort((a, b) => a - b); return sorted[Math.floor(sorted.length / 2)] ?? 1000; }; +const TURN_FREE_TYPES = new Set(['arrive', 'depart']); +const STRAIGHT_TYPES = new Set(['continue', 'new name', 'notification', 'use lane']); +/** Whether a maneuver changes direction enough to deserve framing. */ +export function framesManeuver(maneuver: GuidanceManeuver | undefined): boolean { + if (!maneuver || TURN_FREE_TYPES.has(maneuver.type)) return false; + return !(STRAIGHT_TYPES.has(maneuver.type) && (maneuver.modifier === undefined || maneuver.modifier === 'straight')); +} + +/** Whether the following maneuver comes within about ten seconds of travel after the upcoming one. */ +export function followsClosely(following: FollowingManeuver | undefined, typicalSpeed: number, seconds = 10): boolean { + if (!following) return false; + const byTime = following.afterUpcomingSeconds > 0 ? following.afterUpcomingSeconds : Infinity; + const byDistance = following.afterUpcomingMeters / Math.max(0.5, typicalSpeed); + return Math.min(byTime, byDistance) <= seconds; +} + +/** + * Stateful first-person camera planner, fed only by accepted native navigation state. One frame + * per distinct fix (duplicate timestamps return the previous frame); the map animates linearly + * to it over one fix interval, so puck and camera share one clock and React renders at 1 Hz. + */ +export class GuidanceCamera { + private frame: CameraFrame | null = null; + private lastFixMs: number | null = null; + private intervals: number[] = []; + private bearing: number | null = null; + private bearingTrusted = false; + /** Converging after leaving the dead band; stops once within half a degree (no residual tilt). */ + private rotating = false; + private zoom: number | null = null; + private cruise: number | null = null; + private speed = 0; + private latchedManeuver: string | null = null; + private mode: CameraMode | null = null; + private viewportKey = ''; + private recenters = 0; + + get current() { return this.frame; } + get expectedIntervalMs() { return this.intervals.length ? Math.min(2000, Math.max(600, median(this.intervals))) : 1000; } + + /** A one-off ~500 ms transition back to the follow pose (Ricentra). */ + recenter(): CameraFrame | null { + if (!this.frame) return null; + this.recenters += 1; + this.frame = { ...this.frame, key: `${this.frame.key}#r${this.recenters}`, durationMs: 500, easing: 'ease' }; + return this.frame; + } + + update(input: CameraInput): CameraFrame | null { + const profile = CAMERA_PROFILES[input.mode]; + const fix = input.fix; + if (!fix) return this.frame; + const fixMs = fix.elapsedMs ?? fix.timestamp; + const viewportKey = `${input.viewport.width}x${input.viewport.height}:${input.viewport.top}:${input.viewport.bottom}`; + const modeChanged = this.mode !== input.mode; + const layoutChanged = viewportKey !== this.viewportKey; + // Duplicate or re-delivered samples (GPS + fused, a re-published snapshot) never move the camera. + if (this.frame && fixMs === this.lastFixMs && !modeChanged && !layoutChanged) { + const wasUsable = this.frame.puck.kind !== 'retained'; + if (wasUsable === input.usable) return this.frame; + // Usability changed without a new fix: the camera holds still (no lead is taken back); only + // the puck changes, drawn at the last accepted position. + const coordinate = { latitude: fix.latitude, longitude: fix.longitude }; + this.frame = { ...this.frame, puck: { ...this.frame.puck, coordinate, kind: !input.usable ? 'retained' : this.bearingTrusted ? 'wedge' : 'dot' } }; + return this.frame; + } + if (modeChanged) { this.mode = input.mode; this.cruise = null; this.zoom = null; } + this.viewportKey = viewportKey; + + let gapMs = 0; + if (this.lastFixMs !== null && fixMs > this.lastFixMs) { + gapMs = fixMs - this.lastFixMs; + if (gapMs <= 3000) { this.intervals.push(gapMs); if (this.intervals.length > 5) this.intervals.shift(); } + } + const fresh = this.lastFixMs === null || fixMs !== this.lastFixMs; + this.lastFixMs = fixMs; + const interval = this.expectedIntervalMs; + // A first fix, a fix after a long gap or a layout change eases instead of gliding. + const recovering = this.frame === null || gapMs > 2.5 * interval || layoutChanged || modeChanged; + + if (fresh && fix.speedMps !== undefined) this.speed = this.speed * 0.6 + fix.speedMps * 0.4; + const speed = fix.speedMps ?? this.speed; + const route = input.route; + const traveled = input.progress?.traveledMeters; + const aligned = input.alignment === 'aligned' && route !== null && traveled !== undefined; + const maneuverOffset = route && input.upcoming ? offsetOfIndex(route, input.upcoming.geometryIndex) : undefined; + + // Position: route-snapped only for cycling/driving while alignment is credible. + const useSnapped = profile.snapToRoute && aligned && input.snapped !== undefined + && distanceMeters(input.snapped, fix) <= Math.max(15, fix.accuracyMeters); + const base: Coordinate = useSnapped ? input.snapped! : { latitude: fix.latitude, longitude: fix.longitude }; + + // Course-up bearing, circularly filtered; held when slow or untrustworthy. + const moving = fix.speedMps === undefined ? true : fix.speedMps >= profile.holdSpeed; + if (!moving) this.rotating = false; + const courseOk = fix.course !== undefined && (fix.speedMps ?? 0) >= profile.courseSpeed + && (fix.courseAccuracyDegrees === undefined || fix.courseAccuracyDegrees <= 35); + let target: number | null = null; + if (input.usable && moving) { + const routeBearing = aligned && !input.traceOnly + ? routeBearingAt(route!, traveled!, profile.routeLookAhead, maneuverOffset ?? Infinity) : null; + if (routeBearing !== null && courseOk && Math.abs(angleDelta(routeBearing, fix.course!)) > 45) target = fix.course!; + else target = routeBearing ?? (courseOk ? fix.course! : null); + } + if (target !== null) { + if (this.bearing === null) this.bearing = target; + else { + const delta = angleDelta(normalizeBearing(this.bearing), target); + if (Math.abs(delta) > profile.bearingDeadBand) this.rotating = true; + else if (Math.abs(delta) < 0.5) this.rotating = false; + if (this.rotating) this.bearing += delta * (recovering ? 1 : profile.bearingGain); + } + this.bearingTrusted = true; + } + const bearing = this.bearing ?? 0; + + // Presentation-only lead: bounded to one interval, never through the upcoming maneuver, + // never on a degraded, recovering or late fix. It never feeds navigation state. + let center = base; + let lead = 0; + if (profile.extrapolate && input.usable && !recovering && !input.traceOnly && speed >= profile.courseSpeed) { + lead = Math.min(30, speed * interval / 1000); + if (useSnapped && route && traveled !== undefined) { + if (maneuverOffset !== undefined) lead = Math.max(0, Math.min(lead, maneuverOffset - traveled - 3)); + center = pointAt(route, traveled + lead); + } else if (courseOk) center = offsetCoordinate(base, fix.course!, lead); + else lead = 0; + } + + // Zoom: speed-aware cruise with hysteresis; turn framing pulls it out, release eases it back. + const cruiseNow = profile.cruiseZoom(this.speed); + if (this.cruise === null || Math.abs(cruiseNow - this.cruise) >= 0.3) this.cruise = cruiseNow; + const anchorY = input.viewport.top + profile.anchor * Math.max(0, input.viewport.bottom - input.viewport.top); + const padding = paddingForAnchor(input.viewport, anchorY); + const size = { width: input.viewport.width, height: input.viewport.height }; + const rect: VisibleRect = { left: 16, right: input.viewport.width - 16, top: input.viewport.top + 12, bottom: input.viewport.bottom - 12 }; + + let framing: CameraFrame['framing'] = null; + let targetZoom = this.cruise; + const upcoming = input.upcoming; + if (upcoming && input.usable && !input.traceOnly && route && maneuverOffset !== undefined && traveled !== undefined && framesManeuver(upcoming)) { + const toManeuver = input.distanceToManeuverMeters ?? Math.max(0, maneuverOffset - traveled); + const seconds = toManeuver / Math.max(speed, profile.courseSpeed); + if (this.latchedManeuver !== upcoming.id && seconds <= profile.anticipationSeconds) this.latchedManeuver = upcoming.id; + if (this.latchedManeuver === upcoming.id) { + const points = sample(sliceRoute(route, maneuverOffset, maneuverOffset + profile.outgoingMeters), 8); + const following = input.following; + if (following && followsClosely(following, profile.typicalSpeed)) { + const followingOffset = offsetOfIndex(route, following.geometryIndex); + points.push(...sample(sliceRoute(route, followingOffset, followingOffset + profile.outgoingMeters * 0.6), 6)); + } + framing = { maneuverId: upcoming.id, points }; + targetZoom = solveZoom({ center, bearing: normalizeBearing(bearing), pitch: profile.pitch, padding, zoom: this.cruise }, size, rect, points, profile.minZoom); + } + } + if (this.zoom === null || recovering) this.zoom = targetZoom; + else { + const seconds = Math.max(0.5, Math.min(2, interval / 1000)); + const delta = targetZoom - this.zoom; + // Zoom out quickly enough to show the junction; ease back in over 2–3 s after the turn. + const limit = (delta < 0 ? 1.1 : 0.45) * seconds; + if (Math.abs(delta) >= 0.05) this.zoom += Math.max(-limit, Math.min(limit, delta)); + } + + const kind: PuckKind = !input.usable ? 'retained' : this.bearingTrusted ? 'wedge' : 'dot'; + this.frame = { + key: `${fixMs}:${input.routeRevision ?? 0}:${input.mode}:${viewportKey}:${input.usable ? 1 : 0}`, + center, bearing: normalizeBearing(bearing), pitch: profile.pitch, zoom: round(this.zoom, 3), padding, + durationMs: recovering ? 500 : interval, easing: recovering ? 'ease' : 'linear', + anchor: { x: input.viewport.width / 2, y: anchorY }, + puck: { coordinate: base, heading: this.bearingTrusted ? normalizeBearing(bearing) : null, kind }, + framing, leadMeters: round(lead, 1), + }; + return this.frame; + } +} + +const round = (value: number, digits: number) => Math.round(value * 10 ** digits) / 10 ** digits; +/** At most `count` evenly spread points (always including both ends). */ +function sample(points: Coordinate[], count: number): Coordinate[] { + if (points.length <= count) return [...points]; + return Array.from({ length: count }, (_, i) => points[Math.round(i * (points.length - 1) / (count - 1))]!); +} + +/** Largest zoom (≤ pose.zoom, ≥ minZoom) at which every point projects inside `rect`. */ +export function solveZoom(pose: CameraPose, size: { width: number; height: number }, rect: VisibleRect, points: Coordinate[], minZoom: number): number { + for (let zoom = pose.zoom; zoom >= minZoom; zoom -= 0.1) { + const candidate = { ...pose, zoom }; + if (points.every(point => inside(project(candidate, size, point), rect))) return round(zoom, 2); + } + return minZoom; +} + +/** Overview: the remaining route, north-up and flat, framed once. */ +export function overviewBounds(route: RouteMeasure, traveled: number, position?: Coordinate): [number, number, number, number] | null { + const points = sliceRoute(route, traveled, route.length); + if (position) points.push(position); + if (points.length === 0) return null; + let [west, south, east, north] = [Infinity, Infinity, -Infinity, -Infinity]; + for (const point of points) { + west = Math.min(west, point.longitude); east = Math.max(east, point.longitude); + south = Math.min(south, point.latitude); north = Math.max(north, point.latitude); + } + const pad = 0.0004; + return [west - pad, south - pad, east + pad, north + pad]; +} + +/** Follow / free / overview. Gestures enter free at gesture start; fixes and reroutes never leave it. */ +export type CameraIntent = 'follow' | 'free' | 'overview'; +export type CameraIntentEvent = 'gesture' | 'recenter' | 'overview' | 'reset'; +export function nextIntent(current: CameraIntent, event: CameraIntentEvent): CameraIntent { + switch (event) { + case 'gesture': return 'free'; + case 'overview': return 'overview'; + case 'recenter': case 'reset': return 'follow'; + } + return current; +} diff --git a/src/features/navigation/guidance-fixtures.ts b/src/features/navigation/guidance-fixtures.ts new file mode 100644 index 0000000..5f18a24 --- /dev/null +++ b/src/features/navigation/guidance-fixtures.ts @@ -0,0 +1,81 @@ +import type { Coordinate } from '../../domain/types'; +import type { FollowingManeuver, GuidanceManeuver, NavigationFix } from '../../domain/navigation'; +import { bearingDegrees, measureRoute, offsetCoordinate, offsetOfIndex, pointAt, type RouteMeasure } from './route-measure'; +import type { CameraInput, CameraMode, GuidanceViewport } from './guidance-camera'; + +/** + * Deterministic route fixtures for camera and banner tests: a polyline built from (bearing, metres) + * legs in 5 m points, with one maneuver at each leg start, and a 1 Hz trajectory generator. + */ +export const TURIN: Coordinate = { latitude: 45.0703, longitude: 7.6869 }; +export const PHONE: GuidanceViewport = { width: 412, height: 860, top: 150, bottom: 780 }; + +/** A fixture maneuver's point (fixtures always carry coordinates). */ +export const maneuverPoint = (m: GuidanceManeuver): Coordinate => ({ latitude: m.latitude!, longitude: m.longitude! }); + +export interface FixtureLeg { bearing: number; meters: number; type?: string; modifier?: GuidanceManeuver['modifier']; exit?: number } +export interface RouteFixture { route: RouteMeasure; maneuvers: GuidanceManeuver[] } + +export function routeFixture(legs: FixtureLeg[], revision = 1): RouteFixture { + const points: Coordinate[] = [TURIN]; + const starts: number[] = []; + for (const leg of legs) { + starts.push(points.length - 1); + const count = Math.max(1, Math.round(leg.meters / 5)); + for (let i = 0; i < count; i += 1) points.push(offsetCoordinate(points[points.length - 1]!, leg.bearing, leg.meters / count)); + } + const route = measureRoute(points); + const maneuvers: GuidanceManeuver[] = legs.map((leg, k) => ({ + id: `${revision}:${k}`, stepIndex: k, geometryIndex: starts[k]!, type: k === 0 ? 'depart' : leg.type ?? 'turn', + ...(leg.modifier ? { modifier: leg.modifier } : {}), ...(leg.exit ? { exit: leg.exit } : {}), + instruction: `Passo ${k}`, ...pointAt(route, offsetOfIndex(route, starts[k]!)), + })); + maneuvers.push({ id: `${revision}:${legs.length}`, stepIndex: legs.length, geometryIndex: points.length - 1, type: 'arrive', instruction: 'Arrivo', ...points[points.length - 1]! }); + return { route, maneuvers }; +} + +/** Upcoming/following maneuvers and distance at a route offset, like the native snapshot. */ +export function guidanceAt(fixture: RouteFixture, traveled: number, speed: number) { + const offsets = fixture.maneuvers.map(m => offsetOfIndex(fixture.route, m.geometryIndex)); + // Ferrostar advances once the maneuver point is passed. + const upcomingIndex = offsets.findIndex((offset, k) => k > 0 && offset > traveled + 0.5); + const index = upcomingIndex < 0 ? fixture.maneuvers.length - 1 : upcomingIndex; + const upcoming = fixture.maneuvers[index]; + const next = fixture.maneuvers[index + 1]; + const following: FollowingManeuver | undefined = next ? { + ...next, afterUpcomingMeters: offsets[index + 1]! - offsets[index]!, afterUpcomingSeconds: (offsets[index + 1]! - offsets[index]!) / Math.max(0.5, speed), + } : undefined; + return { upcoming, following, distanceToManeuverMeters: Math.max(0, offsets[index]! - traveled) }; +} + +export interface TrajectoryOptions { + mode: CameraMode; speed: number; seconds: number; startOffset?: number; lateralMeters?: number; + accuracy?: number; course?: (t: number, routeBearing: number) => number | undefined; speedAt?: (t: number) => number; + alignment?: CameraInput['alignment']; usable?: (t: number) => boolean; viewport?: GuidanceViewport; +} + +/** 1 Hz camera inputs along a fixture route. */ +export function trajectory(fixture: RouteFixture, options: TrajectoryOptions): CameraInput[] { + const inputs: CameraInput[] = []; + let traveled = options.startOffset ?? 0; + for (let t = 0; t < options.seconds; t += 1) { + const speed = options.speedAt ? options.speedAt(t) : options.speed; + const position = pointAt(fixture.route, traveled); + const ahead = pointAt(fixture.route, Math.min(fixture.route.length, traveled + 3)); + const routeBearing = bearingDegrees(position, ahead); + const raw = options.lateralMeters ? offsetCoordinate(position, routeBearing + 90, options.lateralMeters) : position; + const course = options.course ? options.course(t, routeBearing) : speed >= 1 ? routeBearing : undefined; + const fix: NavigationFix = { + ...raw, accuracyMeters: options.accuracy ?? 5, timestamp: 1_800_000_000_000 + t * 1000, elapsedMs: 10_000 + t * 1000, speedMps: speed, + ...(course !== undefined ? { course: (course + 360) % 360, courseAccuracyDegrees: 8 } : {}), + }; + inputs.push({ + mode: options.mode, fix, usable: options.usable ? options.usable(t) : true, route: fixture.route, routeRevision: 1, + progress: { traveledMeters: traveled, routeLengthMeters: fixture.route.length, segmentIndex: 0, stepIndex: 0 }, + alignment: options.alignment ?? 'aligned', snapped: position, viewport: options.viewport ?? PHONE, + ...guidanceAt(fixture, traveled, speed), + }); + traveled = Math.min(fixture.route.length, traveled + speed); + } + return inputs; +} diff --git a/src/features/navigation/map-projection.ts b/src/features/navigation/map-projection.ts new file mode 100644 index 0000000..514e67f --- /dev/null +++ b/src/features/navigation/map-projection.ts @@ -0,0 +1,63 @@ +import type { Coordinate } from '../../domain/types'; + +/** + * Screen projection matching MapLibre's transform (512 px tiles, vertical field of view 36.87°, + * camera distance from the full viewport height, padding as a principal-point offset). The camera + * planner uses it to place the puck and to check that a junction is framed before issuing a move; + * device runs compare it with `MapRef.project`. + */ +export interface ScreenSize { width: number; height: number } +export interface Padding { top: number; right: number; bottom: number; left: number } +export interface CameraPose { center: Coordinate; zoom: number; bearing: number; pitch: number; padding: Padding } +export interface ScreenPoint { x: number; y: number } + +const FIELD_OF_VIEW = 0.6435011087932844; +const TILE = 512; +const rad = (degrees: number) => degrees * Math.PI / 180; + +function world(point: Coordinate, zoom: number) { + const size = TILE * 2 ** zoom; + const latitude = Math.max(-85.051129, Math.min(85.051129, point.latitude)); + return { + x: ((point.longitude + 180) / 360) * size, + y: ((1 - Math.log(Math.tan(Math.PI / 4 + rad(latitude) / 2)) / Math.PI) / 2) * size, + }; +} + +/** Screen point of the padded centre: where the camera's `center` coordinate is drawn. */ +export function principalPoint(size: ScreenSize, padding: Padding): ScreenPoint { + return { x: size.width / 2 + (padding.left - padding.right) / 2, y: size.height / 2 + (padding.top - padding.bottom) / 2 }; +} + +/** Projects a ground coordinate; `null` behind the camera or beyond the horizon. */ +export function project(pose: CameraPose, size: ScreenSize, point: Coordinate): ScreenPoint | null { + const c = world(pose.center, pose.zoom); + const p = world(point, pose.zoom); + const dx = p.x - c.x; const dy = p.y - c.y; + const b = rad(pose.bearing); const pitch = rad(pose.pitch); + const right = dx * Math.cos(b) + dy * Math.sin(b); + const forward = dx * Math.sin(b) - dy * Math.cos(b); + const distance = 0.5 * size.height / Math.tan(FIELD_OF_VIEW / 2); + const depth = distance + forward * Math.sin(pitch); + if (depth <= distance * 0.05) return null; + const principal = principalPoint(size, pose.padding); + return { x: principal.x + right * distance / depth, y: principal.y - forward * Math.cos(pitch) * distance / depth }; +} + +/** + * Padding that draws the camera centre at `anchorY` (screen y, from the top). MapLibre centres the + * padded rectangle, so a LOW anchor needs TOP padding: bottom padding alone moves the centre up. + */ +export function paddingForAnchor(size: ScreenSize, anchorY: number): Padding { + const y = Math.max(0, Math.min(size.height, anchorY)); + return { top: Math.max(0, 2 * y - size.height), right: 0, bottom: Math.max(0, size.height - 2 * y), left: 0 }; +} + +export interface VisibleRect { left: number; top: number; right: number; bottom: number } +export const inside = (point: ScreenPoint | null, rect: VisibleRect) => point !== null + && point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom; + +/** Metres per screen point at the centre (MapLibre logical points). */ +export function metersPerPoint(latitude: number, zoom: number): number { + return 40_075_016.686 * Math.cos(rad(latitude)) / (TILE * 2 ** zoom); +} diff --git a/src/features/navigation/route-measure.test.ts b/src/features/navigation/route-measure.test.ts new file mode 100644 index 0000000..89687cd --- /dev/null +++ b/src/features/navigation/route-measure.test.ts @@ -0,0 +1,28 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { angleDelta, bearingDegrees, distanceMeters, measureRoute, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, segmentAt, sliceRoute } from './route-measure'; +import { maneuverPoint, routeFixture, TURIN } from './guidance-fixtures'; + +test('route offsets use the native haversine metric on the bridged geometry', () => { + const { route, maneuvers } = routeFixture([{ bearing: 0, meters: 200 }, { bearing: 90, meters: 150, modifier: 'right' }, { bearing: 0, meters: 100, modifier: 'left' }]); + assert.ok(Math.abs(route.length - 450) < 0.5); + assert.ok(Math.abs(offsetOfIndex(route, maneuvers[1]!.geometryIndex) - 200) < 0.5); + assert.ok(Math.abs(offsetOfIndex(route, maneuvers[2]!.geometryIndex) - 350) < 0.5); + assert.ok(distanceMeters(pointAt(route, 200), maneuverPoint(maneuvers[1]!)) < 0.01); + assert.equal(segmentAt(route, -5), 0); + assert.equal(segmentAt(route, 1e9), route.points.length - 2); + const slice = sliceRoute(route, 190, 230); + assert.ok(Math.abs(slice.slice(1).reduce((sum, point, i) => sum + distanceMeters(slice[i]!, point), 0) - 40) < 0.5, 'slice keeps the corner'); +}); + +test('bearings wrap across north and the route bearing stops at the next maneuver', () => { + assert.equal(angleDelta(359, 1), 2); + assert.equal(angleDelta(1, 359), -2); + assert.equal(angleDelta(10, 190), 180); + assert.ok(Math.abs(bearingDegrees(TURIN, offsetCoordinate(TURIN, 359, 50)) - 359) < 0.05); + const { route } = routeFixture([{ bearing: 0, meters: 200 }, { bearing: 90, meters: 150, modifier: 'right' }]); + // 10 m before a right turn with a 30 m look-ahead limited to the turn: still north. + assert.ok(Math.abs(angleDelta(routeBearingAt(route, 190, 30, 200)!, 0)) < 0.5); + assert.ok(Math.abs(angleDelta(routeBearingAt(route, 190, 30)!, 0)) > 20, 'unlimited look-ahead cuts the corner'); + assert.equal(routeBearingAt(measureRoute([TURIN]), 0, 10), null); +}); diff --git a/src/features/navigation/route-measure.ts b/src/features/navigation/route-measure.ts new file mode 100644 index 0000000..b5f85d9 --- /dev/null +++ b/src/features/navigation/route-measure.ts @@ -0,0 +1,104 @@ +import type { Coordinate } from '../../domain/types'; + +/** Mean Earth radius used by the native haversine (NavigationGeometry), so offsets agree. */ +const EARTH_RADIUS = 6_371_000; +const rad = (degrees: number) => degrees * Math.PI / 180; +const deg = (radians: number) => radians * 180 / Math.PI; + +export function distanceMeters(a: Coordinate, b: Coordinate): number { + const dLat = rad(b.latitude - a.latitude); + const dLon = rad(b.longitude - a.longitude); + const h = Math.sin(dLat / 2) ** 2 + Math.cos(rad(a.latitude)) * Math.cos(rad(b.latitude)) * Math.sin(dLon / 2) ** 2; + return 2 * EARTH_RADIUS * Math.asin(Math.sqrt(Math.min(1, Math.max(0, h)))); +} + +/** Initial compass bearing from a to b in [0, 360). */ +export function bearingDegrees(a: Coordinate, b: Coordinate): number { + const phi1 = rad(a.latitude); const phi2 = rad(b.latitude); const dLambda = rad(b.longitude - a.longitude); + const y = Math.sin(dLambda) * Math.cos(phi2); + const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(dLambda); + return (deg(Math.atan2(y, x)) + 360) % 360; +} + +/** Point reached from `from` after `meters` along compass `bearing` (local flat approximation). */ +export function offsetCoordinate(from: Coordinate, bearing: number, meters: number): Coordinate { + const b = rad(bearing); + return { + latitude: from.latitude + (meters * Math.cos(b)) / (EARTH_RADIUS * Math.PI / 180), + longitude: from.longitude + (meters * Math.sin(b)) / (EARTH_RADIUS * Math.PI / 180 * Math.cos(rad(from.latitude))), + }; +} + +/** Signed shortest angular difference `to - from` in (-180, 180]. */ +export function angleDelta(from: number, to: number): number { + const d = ((to - from) % 360 + 540) % 360 - 180; + return d === -180 ? 180 : d; +} +export const normalizeBearing = (value: number) => ((value % 360) + 360) % 360; + +/** + * Immutable measure over one route revision's geometry: cumulative haversine distance (the metric + * the native progress offset uses), interpolation and slices by route offset. + */ +export interface RouteMeasure { + readonly points: readonly Coordinate[]; + readonly cumulative: Float64Array; + readonly length: number; +} + +export function measureRoute(points: readonly Coordinate[]): RouteMeasure { + const cumulative = new Float64Array(points.length); + for (let i = 1; i < points.length; i += 1) cumulative[i] = cumulative[i - 1]! + distanceMeters(points[i - 1]!, points[i]!); + return { points, cumulative, length: points.length ? cumulative[points.length - 1]! : 0 }; +} + +/** Index i such that cumulative[i] <= offset < cumulative[i + 1] (clamped to the last segment). */ +export function segmentAt(route: RouteMeasure, offset: number): number { + const { cumulative, points } = route; + if (points.length < 2) return 0; + let lo = 0; let hi = points.length - 1; + if (offset <= 0) return 0; + if (offset >= route.length) return points.length - 2; + while (hi - lo > 1) { + const mid = (lo + hi) >> 1; + if (cumulative[mid]! <= offset) lo = mid; else hi = mid; + } + return lo; +} + +export function pointAt(route: RouteMeasure, offset: number): Coordinate { + const { points, cumulative } = route; + if (points.length === 0) return { latitude: 0, longitude: 0 }; + if (points.length === 1) return points[0]!; + const clamped = Math.min(route.length, Math.max(0, offset)); + const i = segmentAt(route, clamped); + const a = points[i]!; const b = points[i + 1]!; + const span = cumulative[i + 1]! - cumulative[i]!; + const t = span > 0 ? (clamped - cumulative[i]!) / span : 0; + return { latitude: a.latitude + (b.latitude - a.latitude) * t, longitude: a.longitude + (b.longitude - a.longitude) * t }; +} + +/** Points of the route between two offsets, both ends interpolated. */ +export function sliceRoute(route: RouteMeasure, from: number, to: number): Coordinate[] { + if (route.points.length < 2) return [...route.points]; + const start = Math.max(0, Math.min(from, to)); const end = Math.min(route.length, Math.max(from, to)); + const result = [pointAt(route, start)]; + for (let i = segmentAt(route, start) + 1; i < route.points.length && route.cumulative[i]! < end; i += 1) result.push(route.points[i]!); + result.push(pointAt(route, end)); + return result; +} + +/** + * Bearing of the route ahead of `offset`: from the point at `offset` to the point `lookAhead` metres + * further, never beyond `limit` (the next maneuver), so the camera does not rotate before a turn. + */ +export function routeBearingAt(route: RouteMeasure, offset: number, lookAhead: number, limit = Infinity): number | null { + if (route.points.length < 2) return null; + const end = Math.min(route.length, offset + lookAhead, Math.max(offset + 2, limit)); + const start = Math.max(0, Math.min(offset, end - 2)); + const a = pointAt(route, start); const b = pointAt(route, end); + return distanceMeters(a, b) < 0.5 ? null : bearingDegrees(a, b); +} + +/** Route offset of a geometry index. */ +export const offsetOfIndex = (route: RouteMeasure, index: number) => route.cumulative[Math.max(0, Math.min(route.points.length - 1, Math.round(index)))] ?? 0; From fca80a03f51c2960c4288b42326467f0e97b9c64 Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli <27171200+fcastrovilli@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:34:11 +0100 Subject: [PATCH 2/5] Drive a first-person guidance camera from accepted navigation state The guidance map is now app-controlled: one native ease per distinct accepted fix (linear over the measured fix interval, so puck and map share one clock and React renders at 1 Hz), course-up with circular filtering and a held bearing when slow, per-mode pitch/zoom, and the puck anchored low in the map between banner and bottom strip through top padding. Turn framing keeps the junction and outgoing path in view from 8/10/12 s before the maneuver and releases over 2-3 s. Cycling and driving add a bounded presentation-only lead that never crosses the upcoming maneuver and stops on degraded or late fixes. Camera intent is follow / free / overview: a gesture enters free at gesture start and blocks pending moves; overview frames the remaining route north-up once; Ricentra restores the follow pose in one 500 ms move; fixes and reroutes never take the camera back. The puck is original artwork (wedge with live centre, disc without a direction, subdued ring for a retained position), drawn at the anchor while following and as a map symbol otherwise. Development builds log MapLibre's own projection of the anchor and junction for assertions. --- assets/navigation/puck-dot-dark.png | Bin 0 -> 1050 bytes assets/navigation/puck-dot-dark@2x.png | Bin 0 -> 2083 bytes assets/navigation/puck-dot-dark@3x.png | Bin 0 -> 3138 bytes assets/navigation/puck-dot-light.png | Bin 0 -> 1128 bytes assets/navigation/puck-dot-light@2x.png | Bin 0 -> 2214 bytes assets/navigation/puck-dot-light@3x.png | Bin 0 -> 3256 bytes assets/navigation/puck-retained-dark.png | Bin 0 -> 1197 bytes assets/navigation/puck-retained-dark@2x.png | Bin 0 -> 2097 bytes assets/navigation/puck-retained-dark@3x.png | Bin 0 -> 3166 bytes assets/navigation/puck-retained-light.png | Bin 0 -> 1184 bytes assets/navigation/puck-retained-light@2x.png | Bin 0 -> 2078 bytes assets/navigation/puck-retained-light@3x.png | Bin 0 -> 3111 bytes assets/navigation/puck-wedge-dark.png | Bin 0 -> 1218 bytes assets/navigation/puck-wedge-dark@2x.png | Bin 0 -> 2456 bytes assets/navigation/puck-wedge-dark@3x.png | Bin 0 -> 3708 bytes assets/navigation/puck-wedge-light.png | Bin 0 -> 1314 bytes assets/navigation/puck-wedge-light@2x.png | Bin 0 -> 2541 bytes assets/navigation/puck-wedge-light@3x.png | Bin 0 -> 3815 bytes scripts/render-navigation-assets.mjs | 128 ++++++++++++++++++ src/features/app/AppMap.tsx | 16 ++- src/features/app/AppShell.tsx | 11 +- src/features/map/MapCanvas.native.tsx | 35 ++++- src/features/map/MapCanvas.types.ts | 6 + src/features/map/guidance-puck.ts | 26 ++++ src/features/map/useGuidanceCameraDriver.ts | 80 +++++++++++ src/features/map/useMapCamera.ts | 27 +++- src/features/navigation/NavigationPanel.tsx | 26 +++- .../navigation/guidance-camera.test.ts | 12 ++ src/features/navigation/guidance-camera.ts | 42 ++++-- src/features/navigation/useGuidanceCamera.ts | 62 +++++++++ 30 files changed, 437 insertions(+), 34 deletions(-) create mode 100644 assets/navigation/puck-dot-dark.png create mode 100644 assets/navigation/puck-dot-dark@2x.png create mode 100644 assets/navigation/puck-dot-dark@3x.png create mode 100644 assets/navigation/puck-dot-light.png create mode 100644 assets/navigation/puck-dot-light@2x.png create mode 100644 assets/navigation/puck-dot-light@3x.png create mode 100644 assets/navigation/puck-retained-dark.png create mode 100644 assets/navigation/puck-retained-dark@2x.png create mode 100644 assets/navigation/puck-retained-dark@3x.png create mode 100644 assets/navigation/puck-retained-light.png create mode 100644 assets/navigation/puck-retained-light@2x.png create mode 100644 assets/navigation/puck-retained-light@3x.png create mode 100644 assets/navigation/puck-wedge-dark.png create mode 100644 assets/navigation/puck-wedge-dark@2x.png create mode 100644 assets/navigation/puck-wedge-dark@3x.png create mode 100644 assets/navigation/puck-wedge-light.png create mode 100644 assets/navigation/puck-wedge-light@2x.png create mode 100644 assets/navigation/puck-wedge-light@3x.png create mode 100644 scripts/render-navigation-assets.mjs create mode 100644 src/features/map/guidance-puck.ts create mode 100644 src/features/map/useGuidanceCameraDriver.ts create mode 100644 src/features/navigation/useGuidanceCamera.ts diff --git a/assets/navigation/puck-dot-dark.png b/assets/navigation/puck-dot-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0d2cc8a71f661a84bcca56cb7a5bb4bb3e6e4cca GIT binary patch literal 1050 zcmV+#1m*jQP)Y}T9LAqHfJ6`2k+`+OW5ESD*oKx9t(|iVvCkZ0-#9hS2dEf}4`90|ZrOYSZ+JOp z-E!hBwonB~po}Xbfm9K@hae$9JTrdTP2yO)Yb#bH|D>NhGqS9CX8*G@7P#W90xX+V zfMv4^uxwTVmdz@_6eNH=l{k$C(54y-M9@X?F)h+8okfSbv_|Jf(0M7+I+ciq2Cz+C z8XH09!A!hL&yh-{kj-Y<;*xhd==FMRO{GCikXQ&BmmOM0fQ^j}RI61x@nkZ|5ubj) zZ-X=%4eaghapV*ZfC`O_pmAu>Eow<55>QIn$%ny&Q2hR2Fko*&lZN|&0C55oX^UDi znG9Ulg_IIe&|0HdETY@(vNxebT^breqjE?kh*^147E(&YK{JFYx4@Io0Maxxf<{4M z_`0<0?ChXiF5@h_ySs242j6!N*aP0q=1}JMHa9ofJB=x)?d@&0Ce)}xNCb_7nNgP7 z4Qom#h}ozg6gTj={Rl5ze+AdxxXw}FyLWDbn^FpF><-P*P(%qJ zF)Sa;{{B7+g#v=yDdg?sQ}^%U)%*82;`8+37wA3w(uR2CwK?MBc^=l+*V&qorWzp- zG%RJXYN+M-`1sUHIxLw=r80H$W5yxQmY#WXYinz4O{h=@ArLey3Zwcrhm_VDK?-~t zU;pw1H`|}EcQN1QAK=~B--5?g4}M#V((&p z_^^)ue*Oc4<34*n1uj6l-Db;DqY5DqG%N};0=%3|;Kf_%Pyzn^>32Nu57_f5TxI|% zB@Pb{+43oH0^j`l1n+pWOX$181KfJ;dL`#-TyCsKq=9r4+WdCPOo6Hk(lVeqiMdO3EvS#+sO6&AoE1B{X2)d<7SAR2&&;pf5-^h&b|uxwTVmdz@_vRMUKHdj8t|9DMj UK%e7eiU0rr07*qoM6N<$f&_Z$`v3p{ literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-dot-dark@2x.png b/assets/navigation/puck-dot-dark@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7fb1a3265b0877d057304d9f127df79c3a666abd GIT binary patch literal 2083 zcmb7F`#%#57vI>+mfMKZ>WR55>s2E6%QnVl?$Z;w^x{EnvS=~sm0L)&v6LvqntLKo z$t{<9`J8jUH$B|&3VUFC004jj!O`Ax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oEosiHk}q;J5+G_`Ke5 z>~>VY>H3XutcK}O+F>FyZATiiK`@WpWWLv-^D*aQQw!`0daPrGDMeu%nZpjC>JSj|M>J(cl@W0!ze@V9;2obDv@v2=A8y;ABfI*9a`!aB&&H$_Nx7z(oVxVa zoj2S($_~P`t>9Cj%wFQz;$E5rP&n|aWiA2qVo*9*x4kQ~Q#+5mD=-01H$8#;a zto$LTtC3+tLTIOHH1+-VlC3mSfO-vQEyouIihGncg~B1)Fm#>?8pl#&v87-o`ju(xHCe z3&uAM5mw=$-`#^S+O;Vh%FrX^dy65bDf52X^*d!E%}|`zwZ5ehL1LPqe$b0#1$cx# zH4L^zpy^sEL3uXZf`7#pKPW|J>-5-_+b-QUXaHm8c@$rtOgF8dl%S1fzie-b3k!0$ z8pj%gh0f|rH`(HAPpd`~7)aU6ayt_7dW-kLl8a~96sn6EN$N%)7GQVdBCn2yExhq9(HGqCh;e{#D~je3qXNgN|9G}!1cnBkJU2YVIXI1lu{5(mg!1Dbcr3e+_cga0YWa|hH3=M%PV($DRfKY-xi KW?yX=nEZcMFV&F% literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-dot-dark@3x.png b/assets/navigation/puck-dot-dark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b10f4e4c3197ed4a2d450c38e3e9d5d53004077b GIT binary patch literal 3138 zcmcInYd8~bAD+Xo%{FG3bL23TGf_s3+2yWZ=)uJ_CP_5a~{o)7nR{jU4DpX+!3?kCgB!x;)z1Oos7sH=;^ zVZoX6XGw?&_Bp5NCICPZNbZs~p_7;kWi*_IFS8b{u5cz!D_-tJ}IYu})lr)v%Fof4bV7pOnTCgKS zUUZrpZ*%;MMP_X5kKRkqaV!J+2n8k}dpi}P#4vePx1wkw_ zg}9VWRy}$o#DINbB;*+%9I1(eN%@uBlBIcJ9s1U2bq(r1KZme6=mhA3Bo)FYMFA)j;;NkJWSViephT| zD(Rl5$%(2OY`eQ6DV7?PlV!|V{`%Ee^&)duIfMmQB2#b-k>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K zjly56{P6^qNtZczfC8k-nM?Hrw0SxWkw096l(Ut4EgLwFn4ESYGBm*^>(=%7$ey?wGxcMyB9|8pYE zJh#K!ROfpsQA=9)3+yKo>@{YxYF}?(Km1Q>t&Wi3zE0huRxC0df#{(~UY`Z*t{C{ zdMhAn8q7IE{R{2eo=4|DYN|;ucZ-#cS^G>AaqrYb?=)2=6tK97+iQ_E0ur<6y_@6*6eaXLE%VMsWhL#O!I?*Eh+SH2wmZtsQ61^IVL z6Migf-X(veG#fG$hsb8yHV~4NUt|U<0M$G{Iv3gA(Y#Yv;-g`psmNpwQ^2wjKRqDV zRD+|8kl5Rp%!*g9^7Qo`IxF|2HkJd$*biTFQCpzq31vxeR>%tW<}pGUVtCg0*%<4oXC+z?r2)b7?!6oVg&5Vu4eE2sg#{pGhY zo%W=4UwyuIb^o9vYBjD;9iGN#)HN(T!}F2OAt6uemlVolagb}|n5Lz>ZFropP_2uS z4uzG%Fl?v*#hNdm&pE^nbCL#<8z3!z!qeaLh`O9%Y3aE$%geE4YmPl4(aw(^ZQ|?M z$)}{ROt@xHm4JezL3we8U!U}kEib61Q!Y!l)8j)_3M`d5iDcF#Hi#-2P#8r1dmk*N z*`@yV9tj+IAB~+|C0Mxr8zGunF(wQkiz1xn;!Y>nBk*4P47 zk5aDqS&I^8o3A)~k)Bc45J{<^OHyMO6<3V9s;$rlBJYDN#FcM~m#97t0%{3m@#X6X l2KFGBvP4S2KLrnu0L0bOY-Go#7w`W7*jhPao>}-&{|8NM?8^WE literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-dot-light@3x.png b/assets/navigation/puck-dot-light@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..902856f0bbc1009348057a192b5d16d250d168e7 GIT binary patch literal 3256 zcmcIn`#TftAJ&?hInA68F*E10a%#iOFw~lTg~FT@A|jzw!)$Y?O)GK=O_Z7zda*?g zMe_+Cv*LRr~u#6+Y>eRb%sVOW@J{N;?>ebTL1b4|`?&X*YzkgaW2TV25Wf^N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o^ZKmAZd+U2)VIkVn^Ux%}fp8$0U^L*VktEU!xn{|vBY)z= zNlT*h38;xvr#|gZH4`+Ukq^3xiXDCE(jfAni=+vYfwN~jTu3x0B)NWF^!N6D?lzzjDZJ$l$h(u6~#4VI7%KVTalA1k|c>$iX?{v1H_ z13cCSlK2+!0%8?(2{{}mE%)pDJ?LiF(vo@!+3la03knK(NP-#Og(W1CG?8nd1@Q_Z zB{Yfa>TITj3EKJfc50XF3yZ<9DG&0I8K_3$eKtEAiLO^hjmBa)pFcZ8{xSIyUxKP!LXg(JY%STb|9^v*(S1ZQD!*=uR8! zaYBv(BNA;CGR9ho$w)W8S0n(-$4?kwHbB8{+(qK&AX?wgo$K(j9_HxC$Cuxqh(-j{ z=M%^>K#$Ur^q)uwDMOI3nf|dMY$J`nOrm87P4)1C;oMM#MGpIIfZ9 zXo{6pnv^4Jn4#6Fs;b&pSXjj4HNiC`u9e6{wgC#AiTEXiR+~3VOJ9E9W_!;<4|-Em zlaYyuee&4Aiy2Gr(%g3s(g0h{b000000 LNkvXXu0mjf5=}e0 literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-retained-dark@2x.png b/assets/navigation/puck-retained-dark@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fbc4b570f684d80e206894af6dbb662a8173458f GIT binary patch literal 2097 zcmbuB`#Teg1IA~uO}TBvHflpmMI^FL$ZD9}7ahWD3{4tN;D-*#VWTt8FH!P z+Az5n&fKP$%W#M(hn3s6@858q=kvbrFYnLq^WJfCu$JA6+zS8zWNip|;;$tAUl7nQ zpUREK0svsK4Ibwb^W{&}k$!jXM_hb>OjAasm*&Jkc!LVH6FB+% z)9a*6=0vdYVO(Uh*>t!`!PC*FOkQr1l2#)8zmYpfvNi0>zo?}&$b(j*;ADqE(+9Az8k1BIjlZcs8L212jSm^SU z?iI4GIzYA{gRXD6KyrMEpI-GgknXe?!%g$m)uk@uj~q!DadTevJAPi?*TyJW$td9^ zd(lHzCU!k;?q!+T%DK^7Sy?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+&ujx`#QWa>}%nHQiN;6}?26uiKIDO2xw}D1y69VU7Q;!?T_l zJzwqLRCYD=)jf(H_-1K<10K_iBTW6_Illb6!|!1)aR*pXqV3PM1via|JEJnn$`#wk zysr}6T*xwx0iemqe-P#$f@M+f-vGru%;QvTp$v0gdT=#cU4bM%9ivZr9oEQ0nkNcW z-ohjhWo2b@_dd(D=h6hPt%#Yaz}J0|n_M5IEP(HSWC!dNOUY;gqWHhA0Kmr50na{5 GO8Or*)zBaS literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-retained-dark@3x.png b/assets/navigation/puck-retained-dark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..a21283f34afb90793b6b1213bb727180bd862a09 GIT binary patch literal 3166 zcmcgvi8BrjA z!n&64l5#}3+2km>`T5Q7fB4P3_dfHP&zpHOZ|3u6-h+!amIAydc{w;Z1Tbi%-4SN} zH-RUP>O5+yo`Zv55rZ^y2rF2A8hOFNQKqxM)0`!+M5+l zsjqape>n%HSBc2#-YUQB@Tqn|7IsB;nJz{AhU_z_81-lQI!o47^wfHaKdg5iIfJaF zD5|NV^wjS*-EjM<&75WyoDF35uH@Xi9V0Fap3|K#h-5b0)kA>+S%`SB0$7fd2MII- z2$}zXX_mNP=K(){MTY8=|1g}&rl;!6UFV1y_N)2u<9fUlgppcZ4eF-$_>xfz1A22q z8=R#t7CWadsU9g$&u)qpC5*(vATC>VHXRUugR9ZpslsTemUKpxF`bz~Nh5nTetD_Z)!uSe^w>!65y*Q4XgC%`R5Dkb7d2=KFQT?15ZlX5nSC_ z_YU{pFjNH*t} zGPuVW#FbuUv6QYT*%TBwIBtH)#hu%~&3B*-_Gerx9-ed&W~R#hdzsu#mFpIoOIwS2 z?c(z*(CCgHMOvg{IPbm^AgF&L0A=pTN2W#Zc}`%)XaIZebiuFhG? zFxOMypEDsqoBhHntwofYEWUytn zc2H)jmNV}C&eBa?ndtgMiUTSfex*|DbpO-c8jP|4wKWWViO8G1jWf+N@cXyW^}@Qk z2}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o1zLIcJbu@~@f0eT!@XbH-@W_>&^r z2b%z~tF}wrxHvIKEGU z=goyL1EAKLB#MQYhWE#Aci5RUP%E~yq)6&OuY8CqT2r4S%|q{*`S>dl+#vjIF-e~C4w*>Z zd2kswQXSl$C?~o8nsoiN1V}`7qo4D`m8JS@j4bN36HgZ?cFx7cKNq%!nFX6JsK0Ll zdB7{hQbvb{rn|+xa48S-pIjVN#5A}m4@2ld;P0Kv&Y08GNl`A6FL+u}BCu<>}a=P~{f0-*v;|wk_IlgI5-UpGQXKNTFcK zNvMY?!7`rex|*8LsUtWHzm`&$#v@rhr4evnSsqtNpiqm!W#&u48esv!g!PS?H~abe zQ%&)K#?=oqZaEYggr#06(%Q)@ZE4B8!=cVSI4;Iz9kS-}Mc+v}zTnc#4 z`2=?8abDh3P?EiMOGT1RTbQJ^qg!dPS-DzeL{&&Sh9UH88a}I5LL|<|9WZ%)qqaZe z-D&X&;mu(R9h8+G$BVKKBizC)&_zg2MWM&lIm*HV;5kLdiwC<^FT~|O&m|dk6MFHU z9=Zs-p^^3EFxiY=oOWQ^-y@W6<8X0q*^Wad4enKW{hKcaFt!pn$#NrBQ$a@{UG=*| z7gOeJlvr7Jh=t4}R^D8OtF&6Of)cRvsfkADx87wdKkrga$8|ENX8Bn#_+I<6a-V4S zW6^VN@!HLXu}&6{T5=>*q`?4(O`>F#lNoPIFhXQGlR-jpG5<|{n!8};DFB@CP#`9S zgg*~Cmd;_j(?cW@X9{ZRKqLqUn4^Eu3v1@G%U%FzUgqdH4snOHtrdoTb@^-g5MyjB zeS=Tz>X27jUXe%&p$m$7N^ArqUaifMZ1DT(CnLLke2w)8N!1v@L~GH#{(lkoKhe7D an6=a`c)IGjO4Hv0z+!9VfT**$eD7b4<$omr literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-wedge-dark.png b/assets/navigation/puck-wedge-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..b3cc33c6f08439d1c14ba89acb576e336449b68e GIT binary patch literal 1218 zcmV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S)D+D>)m9>=Xx2;BwADwjhA~it!0W~Z3}~+@>KW*Oi@Eaz*O0m v>+fDyNFn9U8V@2A|68p5Pwn!5#BKSLvsu@TijHc@DlP!t(;wU9emdiCut12L literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-wedge-dark@3x.png b/assets/navigation/puck-wedge-dark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..136e0f749c680fa96f4c86c922e2c37036eab64d GIT binary patch literal 3708 zcma)9dpy(s_m|5=NX#&|F!v@#B}B%U*xZVcluKY%+JBWA!vy-vuA%v z`_DlD`#onq^$!P!kg27a$@$Q%rED7vWEA(VHFa|W0vYQ7a5|@liHUZA-(WbcsMvE| zqgHTp(KH9->;iCZihe0A?v(HSPl-$z*nKK%R!zQ0+FW$1ml1j+rRxe-JG8wks5=z5 zLb)u(I{m4ClBGKllpG$l{FO#XTtO1X?>;*46U+MjR z9+fGtrNTXrI2O}XLomG|oRNn)dL2$HCQ2q3U$RK0#Ab1Cy%|l!WgcZq`FIyyatW6~ zztMIKv zj)82R86l+K3HR%EuCJf8xV&%J^Z5+DLf4u!*ZQ0C-Wbq*$-?WjoIoaoXSQe{?<~Da zI4(Y3-?`jKTv|qE@?*AvbXXP2A&CR=4u4lAA#QQxg<>!4L2hl=!h)Iw+MX#7HYB7R zNRIsVok`EL(CT_F-~+uA5^{P)fg%Y=p?J38r8HbDFR+~ld$K8eOx8XwHgCR+0ov@`cug_t$hV6}YlKBb3$^pbRW6 zLG7WB(#DT39qsK0EN&)gx9}48T_YrdNPNHV8sr$Qhs5AiQ~CSOqAfpuLiQU1k5&9^fCZT(;W@Y@3_tiyxl8>94A< zTUTuDjxJ?@S}yund>OY5!dwjSL}*|s+n1i#hKT9s1GwOH`CPL9m+Z|NXr$$4a2JD3 zg_Q1#s1f;E7k}JyUkVT+XpdvMSf&rn;hUS!7)EZA6#wSHx-23Q&Ur0P-?_kV(yEI9 zLL6a7b%2}eEIn7N04!A5U$@*Tq0_jYKrwBLX}a|-K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Wuraod#j`bn?r#{(2g+1&YV52QRc@sE=$TxD8nzAT5@AoW`y|g$K(Qya zsU5Ifof~B19~FIfVmP@}{)_GEKkr}v7lk`#wYcTyb6FKo_EyPZi9nlG!mr@}2m3$t AsQ>@~ literal 0 HcmV?d00001 diff --git a/assets/navigation/puck-wedge-light.png b/assets/navigation/puck-wedge-light.png new file mode 100644 index 0000000000000000000000000000000000000000..8314271932591e8e274228e22c35f60c53295746 GIT binary patch literal 1314 zcmV+-1>O3IP);ey0uu1mnQGtmWL`n7Rm3e$~X(i(69B`t9pleP+k8gyYFvzD^Ld7bq`&0pduFEhocB3j z_Z7V4Y#G>W>SkbVZOvl%kWwZ@#9=f}Jq;uQd`T%IB9cTMsEYw6Z!s)W8Wo3%NgY<9 zUIvC3zNP$pN&{nzMyZzpo&6{_vO)tfMxzL26egbl@FNvOpNQBnNIeWZVrZo>Gc$uo zB!c$#c7AeMpn*0MVKnJ4{gfaq?k0Nt*x(o~q;>wjtwt!>DdNDqJiLD$l5m|u&Od7C}ee^yyz{XlP)|WkN&}Fn|#QOg@T`+4rc|Dwr}b#&C*4I-SPu-EYBh9DZ8I zvMfA#@~3+%Wf>6z?+0S6Lh?CN-89CJZF8UbJDyj@Juj z-$Pg7*|UGy%29K9VZy*NLlk6kati(Z18jwJ`SLh=dwbY&S)qX#W7P;%HB3GMU)i90 zKb1a={s%mIpnIQ_IWy9ga-R?G-p1z8`dvh-? zmwWf-(cOL2-CozPPouN5li#}3vuWU%AR`KBX`>=S^oS*v{H<#}77od6P z8#vj12$5H|VGmcSxw*+$c~Of2O+F6dl?|Gd&ivb7590BE|L~V}tZlF2;pvN5eDDX3 z964&Nyb!8ln0zb4Bg#b+T3lRo_qNXb=^GdMZ6PQ3eSmX^K6cNF8qIsLwb8@^V?|VJ zz(!u#(ACw2YuB#g-SeMe?(fI^rI3AZw&2$j=iKe4XTn5zQLzCgA4TTH<>HkM6zDBoXP!GEEDvLwKq=NFIQUgh3%Lbi&ok_jd zJ^VBJ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3FzTAPiY10w1| z)hS)(5-NVw-kWH2m9&PSUTHU=?)facS8yV_~DM%#o?_OOmf zB@p;6RxF~cy(&l=?z`;3dLw=S7+cBwZ@7U>wh;&E4C^Gr)HIckDSn(QO14$|pm=OB zF@@mv6`FS&bK=#6<@rWU=9VEAX=BHQG(>wtGx3HZmK{2(1K%a-=R!*lZg3!QU%vy*6}Q0df_3 zmIlY281qBC*J%>#1VpE+HQ)pNePX~hbuo^iF?X|jN`>I7DUj?p-dUQp&7k0FA&Z_aOP_5ef@1|!V)}wzCS(DII zCH{i2-~6+;w;$Lbo{H>;;Y0B$T z4)_O`Njzm`>yIw$wN`fQCTghbz=C{6;wGcp8JnetLvcmtsj}ph7?R&q40_Cj4Rm1{ z5PMGw0Kq&%a1koBK*9nkAJ?`}y$lacS6+Mxu>z?q0`-zGu%V5@I|XNsImJF7I;vdG zVQE@r^Q9{JUe3?KI7e~8*?bNzJZ0t8Vvpe&`8+oIHqLNhc)c3}OQTN>sqy>N5!%-C zI;_Ie?EUJ%H8eJU&d2;G-Vx)gCtQS*F|buEMc-UWkjSP)9cg8uB#cYb!K9OdQ+T5c z!F1))(>GUG5^G1I_<)u`OG$fzzeB6+!AOQJM}`%eAxlmeY+ `` + + ``, + // Direction unknown: a disc, never a guessed heading. + dot: ({ ink, edge, live }) => `` + + ``, + // Last accepted position while guidance is paused: hollow, grey, no live green. + retained: ({ edge, muted }) => `` + + ``, +}; + +const outputs = {}; +for (const [name, draw] of Object.entries(puck)) { + for (const [scheme, colors] of Object.entries(inks)) { + for (const scale of [1, 2, 3]) { + const size = 48 * scale; + outputs[`puck-${name}-${scheme}${scale === 1 ? '' : `@${scale}x`}.png`] = + `${draw(colors)}`; + } + } +} + +/** + * Maneuver glyphs: single-ink (tinted at runtime), 48 dp, drawn for left turns and right-hand + * traffic; the interface mirrors them for right turns and left-hand circulation. + */ +const W = 'stroke="#FFFFFF" fill="none" stroke-linecap="round" stroke-linejoin="round"'; +const head = (x, y, angle) => ``; +const thick = d => ``; +const thin = d => ``; +// Roundabout ring centre and entry; the exit arm leaves at `exitAngle` (compass degrees, screen). +const ring = { x: 24, y: 23, r: 7.5 }; +function roundabout(exitAngle) { + const rad = deg => (deg - 90) * Math.PI / 180; + const on = deg => [ring.x + ring.r * Math.cos(rad(deg)), ring.y + ring.r * Math.sin(rad(deg))]; + const [ex, ey] = on(exitAngle); + const [ox, oy] = [ring.x + (ring.r + 8) * Math.cos(rad(exitAngle)), ring.y + (ring.r + 8) * Math.sin(rad(exitAngle))]; + // Counter-clockwise from the entry to the exit: decreasing compass angle. + // Right-hand traffic enters on the right of the approach (160°), so a U-turn exit stays apart. + const entry = 160; + const sweep = ((entry - exitAngle) % 360 + 360) % 360 || 360; + const large = sweep > 180 ? 1 : 0; + const [sx, sy] = on(entry); + return `` + + thick(`M${sx.toFixed(2)} 45 L${sx.toFixed(2)} ${sy.toFixed(2)} A${ring.r} ${ring.r} 0 ${large} 0 ${ex.toFixed(2)} ${ey.toFixed(2)} L${ox.toFixed(2)} ${oy.toFixed(2)}`) + + head(ox, oy, exitAngle); +} +const glyphs = { + straight: thick('M24 45 L24 12') + head(24, 9, 0), + 'slight-left': thick('M28 45 L28 28 L16 14') + head(14, 11.5, -40), + left: thick('M30 45 L30 26 Q30 20 24 20 L12 20') + head(9, 20, -90), + 'sharp-left': thick('M32 45 L32 16 L15 33') + head(13, 35, -135), + 'uturn-left': thick('M31 45 L31 18 A7.5 7.5 0 0 0 16 18 L16 30') + head(16, 33, 180), + 'fork-left': thin('M24 45 L24 30 L34 12') + thick('M24 45 L24 30 L14 14') + head(12.5, 11.5, -30), + 'merge-left': thin('M16 45 L16 6') + thick('M34 45 L34 32 Q34 24 24 18 L24 12') + head(24, 9, 0), + 'ramp-left': thin('M30 45 L30 6') + thick('M30 45 L30 30 L16 16') + head(14, 13.5, -45), + 'roundabout-right': roundabout(90), + 'roundabout-slight-right': roundabout(45), + 'roundabout-straight': roundabout(0), + 'roundabout-slight-left': roundabout(315), + 'roundabout-left': roundabout(270), + 'roundabout-sharp-left': roundabout(225), + 'roundabout-uturn': roundabout(210), + arrive: thick('M24 45 L24 26') + '', + 'arrive-left': thick('M30 45 L30 18') + '', + // Unknown maneuver: a neutral marker; the supplied text carries the instruction. + unknown: '', +}; +for (const [name, body] of Object.entries(glyphs)) { + for (const scale of [1, 2, 3]) { + const size = 48 * scale; + outputs[`maneuver-${name}${scale === 1 ? '' : `@${scale}x`}.png`] = + `${body}`; + } +} + +// Map symbols: the turn arrowhead (inverse of the route ink, so it reads on top of the route) and +// the one-way chevron restored for driving. Both point up and are rotated on the map. +const arrowhead = { light: ['#FFFFFF', '#09090B'], dark: ['#000000', '#FFFFFF'] }; +const oneway = { light: '#71717A', dark: '#8E8E96' }; +for (const scheme of ['light', 'dark']) { + const [fill, edge] = arrowhead[scheme]; + for (const scale of [1, 2, 3]) { + const suffix = scale === 1 ? '' : `@${scale}x`; + outputs[`arrowhead-${scheme}${suffix}.png`] = `` + + ``; + outputs[`oneway-${scheme}${suffix}.png`] = `` + + ``; + } +} + +const check = process.argv.includes('--check'); +mkdirSync(out, { recursive: true }); +let stale = 0; +for (const [file, svg] of Object.entries(outputs)) { + const png = new Resvg(svg, { font: { loadSystemFonts: false }, shapeRendering: 2, background: undefined }).render().asPng(); + const path = `${out}${file}`; + if (check) { + let current = null; + try { current = readFileSync(path); } catch {} + const same = current && createHash('sha256').update(current).digest('hex') === createHash('sha256').update(png).digest('hex'); + if (!same) { stale += 1; console.error(`stale: assets/navigation/${file}`); } + } else { + writeFileSync(path, png); + } +} +if (!check) console.log(`wrote ${Object.keys(outputs).length} files to assets/navigation/`); +if (stale) process.exit(1); diff --git a/src/features/app/AppMap.tsx b/src/features/app/AppMap.tsx index 8b41280..3fb1b18 100644 --- a/src/features/app/AppMap.tsx +++ b/src/features/app/AppMap.tsx @@ -8,6 +8,8 @@ import { resultFrameBounds } from "../map/map-presentation"; import { searchMapStops } from "../search/search-rows"; import { useMapContext } from "../map/useMapModel"; import { useNavigationContext } from "../navigation/useNavigation"; +import { useGuidanceCamera } from "../navigation/useGuidanceCamera"; +import type { GuidanceViewport } from "../navigation/guidance-camera"; import { usePlacesContext } from "../places/usePlaces"; import { usePlannerContext } from "../planner/usePlanner"; import { useSearchContext } from "../search/useSearch"; @@ -17,8 +19,10 @@ import { useTaskState } from "./useTaskModel"; import { useTheme } from "../../theme"; /** The one mounted map: task pins, planning or guidance route, and camera intent. */ -export function AppMap({ height, padding, attributionLeft, attributionTop }: { +export function AppMap({ height, padding, attributionLeft, attributionTop, guidanceViewport }: { height: number; + /** The unobscured map between the guidance banner and the bottom strip. */ + guidanceViewport: GuidanceViewport; padding: { top: number; right: number; bottom: number; left: number }; attributionLeft: number; attributionTop: number; @@ -63,13 +67,16 @@ export function AppMap({ height, padding, attributionLeft, attributionTop }: { ? { type: "LineString", coordinates: navGeometry.map(toMapCoordinate) } : null, [navGeometry]); const navCenter = navigation.snapshot.location ?? navigation.snapshot.destination ?? camera.center; const navigating = navigation.visible; + // Road guidance: the app-controlled first-person camera; the map never follows on its own. + const guidance = useGuidanceCamera({ snapshot: navigation.snapshot, camera, viewport: guidanceViewport, active: navigating }); return ( planner.chooseOrigin(toCoordinate(coordinate))} onRegionChanged={(coordinate, zoom) => { - if (navigating) { camera.stopFollowing(); return; } + // Guidance enters free at gesture start (see MapCanvas); this settles later. + if (navigating) { if (!guidance) camera.stopFollowing(); return; } userPanned(toCoordinate(coordinate), zoom); }} onPressMarker={(id) => { diff --git a/src/features/app/AppShell.tsx b/src/features/app/AppShell.tsx index 5b70b8e..4861e76 100644 --- a/src/features/app/AppShell.tsx +++ b/src/features/app/AppShell.tsx @@ -1,4 +1,4 @@ -import { useLayoutEffect, useRef } from "react"; +import { useLayoutEffect, useMemo, useRef, useState } from "react"; import { ActivityIndicator, Pressable, StyleSheet, useWindowDimensions, View } from "react-native"; import { Text } from "../../ui/Text"; import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context"; @@ -64,6 +64,11 @@ export function AppShell() { const mapPadding = mapCameraPadding({ width, height: mapHeight, sheetHeight: currentSheetHeight + 8, panelVisible, navigating: navigation.visible, fontScale }); const message = location.message || feedback.message; const dismissMessage = () => location.message ? location.setMessage("") : feedback.dismiss(); + // Measured guidance chrome: the camera places the puck inside the map left between them. + const [guidanceChrome, setGuidanceChrome] = useState({ top: 120, bottom: 190 }); + const guidanceViewport = useMemo(() => ({ width, height: mapHeight, top: Math.min(guidanceChrome.top, mapHeight / 2), bottom: Math.max(mapHeight / 2, mapHeight - guidanceChrome.bottom) }), + [width, mapHeight, guidanceChrome]); + const onGuidanceChrome = (top: number, bottom: number) => setGuidanceChrome(current => Math.abs(current.top - top) < 1 && Math.abs(current.bottom - bottom) < 1 ? current : { top, bottom }); const overlayPosition = { bottom: !wide && panelVisible ? currentSheetHeight + 24 : 88, left: wide && panelVisible ? SIDE_SHEET_WIDTH + 8 : 16, right: 16 }; return ( @@ -73,6 +78,7 @@ export function AppShell() { padding={mapPadding} attributionLeft={wide && panelVisible && !navigation.visible ? SIDE_SHEET_WIDTH - 4 : 8} attributionTop={navigation.visible ? Math.min(height * 0.3, 104 * Math.min(fontScale, 1.5)) + 8 : 68} + guidanceViewport={guidanceViewport} /> {navigation.visible && (navigation.snapshot.mode === "transit" || (navigation.busy === "start" && navigation.startKind === "transit")) ? ( { void navigation.confirmTransit(action); }} onReplan={() => { void planner.replanFromNavigation(); }} onMute={() => { void navigation.toggleMuted(); }} /> ) : navigation.visible ? ( - { void navigation.stop(); }} onRetry={() => { void navigation.retry(); }} onMute={() => { void navigation.toggleMuted(); }} onConfirmTransit={action => { void navigation.confirmTransit(action); }} onReplan={() => { void planner.replanFromNavigation(); }} /> ) : <> diff --git a/src/features/map/MapCanvas.native.tsx b/src/features/map/MapCanvas.native.tsx index d37b716..0f366a5 100644 --- a/src/features/map/MapCanvas.native.tsx +++ b/src/features/map/MapCanvas.native.tsx @@ -1,19 +1,21 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; -import { StyleSheet, View } from 'react-native'; +import { Image, StyleSheet, View } from 'react-native'; import { Text } from '../../ui/Text'; -import { Camera, GeoJSONSource, Layer, Map, type CameraRef, type MapRef } from '@maplibre/maplibre-react-native'; +import { Camera, GeoJSONSource, Images, Layer, Map, type CameraRef, type MapRef } from '@maplibre/maplibre-react-native'; import type { FeatureCollection, Point } from 'geojson'; import { useTheme } from '../../theme'; import { diagnostics } from '../../services/diagnostics'; import type { MapCanvasProps } from './MapCanvas.types'; import { createOnceFraming, createRouteFraming, frameCamera } from './map-presentation'; import { lineLayout, markerLabelLayout, overlayPaint } from './map-overlay-style'; +import { GUIDANCE_IMAGES, puckImage, puckLayout } from './guidance-puck'; +import { useGuidanceCameraDriver } from './useGuidanceCameraDriver'; /** * The one native map. An appearance change swaps `mapStyle` and layer paint in place: Map and Camera * stay mounted, so the camera, route, markers and position survive a Sistema/Chiaro/Scuro switch. */ -export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFitKey, resultFrame, cameraPadding, attributionTop = 68, attributionLeft = 8, markers = [], selectedMarkerId, route, coverageBounds, userLocation, followLocation, onPressMarker, onMapPress, onRegionChanged, onViewChanged }: MapCanvasProps) { +export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFitKey, resultFrame, cameraPadding, attributionTop = 68, attributionLeft = 8, markers = [], selectedMarkerId, route, coverageBounds, userLocation, followLocation, onPressMarker, onMapPress, onRegionChanged, onViewChanged, guidance }: MapCanvasProps) { const theme = useTheme(); const paint = useMemo(() => overlayPaint(theme.map), [theme.map]); const framing = useRef(createRouteFraming()); @@ -37,15 +39,16 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi // centre or bounds, so re-centre on the camera's actual centre: the point the user was looking at // (including after a pan) moves into the newly visible area instead of under the sheet. const { top = 0, right = 0, bottom = 0, left = 0 } = cameraPadding ?? {}; + const guiding = !!guidance; useEffect(() => { - if (!loaded || followLocation === true) return; + if (!loaded || followLocation === true || guiding) return; let current = true; const issued = commands.current; void map.current?.getCenter().then(center => { if (current && issued === commands.current) camera.current?.easeTo({ center, padding: { top, right, bottom, left }, duration: 250 }); }).catch(() => undefined); return () => { current = false; }; - }, [loaded, top, right, bottom, left, followLocation]); + }, [loaded, top, right, bottom, left, followLocation, guiding]); // A submitted search frames its results once; a pan before the results settle consumes the frame. const frameKey = resultFrame?.key; const frameBounds = resultFrame?.ready ? resultFrame.bounds : null; @@ -57,18 +60,28 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi const inset = padding.current ?? { top: 50, right: 50, bottom: 50, left: 50 }; camera.current?.easeTo({ ...frameCamera(frameBounds, size.current, inset), padding: inset, duration: 500 }); }, [loaded, frameKey, frameBounds]); - useEffect(() => { if (followLocation !== false) { commands.current += 1; camera.current?.easeTo({ center: [longitude, latitude], zoom, padding: padding.current, duration: 450 }); } }, [longitude, latitude, zoom, followLocation, cameraRevision]); + const gesture = useGuidanceCameraDriver({ guidance: guidance ?? null, loaded, camera, map, commands, size }); + useEffect(() => { if (followLocation !== false && !guiding) { commands.current += 1; camera.current?.easeTo({ center: [longitude, latitude], zoom, padding: padding.current, duration: 450 }); } }, [longitude, latitude, zoom, followLocation, cameraRevision, guiding]); useEffect(() => { if (followLocation !== undefined || !framing.current.claim(routeFitKey, !!route?.coordinates.length) || !route) return; const xs = route.coordinates.map(p => p[0]!); const ys = route.coordinates.map(p => p[1]!); commands.current += 1; camera.current?.fitBounds([Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)], { padding: padding.current ?? { top: 50, right: 50, bottom: 50, left: 50 }, duration: 500 }); }, [route, routeFitKey, followLocation]); + // Follow: the puck is drawn at the camera's anchor, so it and the map share one animation clock. + // Free, overview or a paused fix: a map symbol at the accepted (or retained) position. + const frame = guidance?.frame ?? null; + const followPuck = guidance?.intent === 'follow' && frame !== null && frame.puck.kind !== 'retained'; + const mapPuck = guidance && frame && !followPuck ? frame.puck : null; + const overlayPuck = followPuck && frame ? { + source: GUIDANCE_IMAGES[puckImage(frame.puck.kind, theme.scheme)]!, x: frame.anchor.x, y: frame.anchor.y, + rotation: frame.puck.heading === null ? 0 : frame.puck.heading - frame.bearing, tilt: Math.round(frame.pitch * 0.55), + } : null; return { size.current = event.nativeEvent.layout; }}> onMapPress?.(event.nativeEvent.lngLat)} // A user gesture outranks a pending padding re-centre (see `commands`). - onRegionWillChange={event => { if (event.nativeEvent.userInteraction) commands.current += 1; }} + onRegionWillChange={event => { if (event.nativeEvent.userInteraction) { commands.current += 1; gesture(); } }} onRegionDidChange={event => { const { center: shown, zoom: shownZoom, userInteraction } = event.nativeEvent; onViewChanged?.(shown, shownZoom); @@ -76,6 +89,7 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi }} onDidFailLoadingMap={() => { setMapError(true); diagnostics.record({ type: 'map', state: 'failed' }); }} onDidFinishLoadingMap={() => { setLoaded(true); setMapError(false); diagnostics.record({ type: 'map', state: 'loaded' }); }}> + {coverage && @@ -91,7 +105,14 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi {userLocation && } + {mapPuck && + + } + {overlayPuck && + + } {mapError && Mappa non disponibile · riprova con una connessione} ; } diff --git a/src/features/map/MapCanvas.types.ts b/src/features/map/MapCanvas.types.ts index af55f22..632b4c2 100644 --- a/src/features/map/MapCanvas.types.ts +++ b/src/features/map/MapCanvas.types.ts @@ -1,4 +1,5 @@ import type { LineString } from 'geojson'; +import type { GuidanceMapState } from '../navigation/useGuidanceCamera'; export type MapCoordinate = [number, number]; export interface MapMarker { id: string; @@ -34,4 +35,9 @@ export interface MapCanvasProps { onViewChanged?: (center: MapCoordinate, zoom: number) => void; /** A user-driven camera change: the new centre and zoom. */ onRegionChanged?: (center: MapCoordinate, zoom: number) => void; + /** + * Active road guidance: the app-controlled first-person camera and puck. While present, the map + * never runs its own following, padding re-centre or route fit, and a gesture enters free at once. + */ + guidance?: GuidanceMapState | null; } diff --git a/src/features/map/guidance-puck.ts b/src/features/map/guidance-puck.ts new file mode 100644 index 0000000..02b5c9c --- /dev/null +++ b/src/features/map/guidance-puck.ts @@ -0,0 +1,26 @@ +import type { SymbolLayerSpecification } from '@maplibre/maplibre-gl-style-spec'; +import type { ColorScheme } from '../../theme/palette'; +import type { PuckKind } from '../navigation/guidance-camera'; + +/** + * Original puck artwork rendered by scripts/render-navigation-assets.mjs: a wedge with a live green + * centre, a disc when the direction is unknown, and a subdued hollow ring for a retained position. + */ +export const GUIDANCE_IMAGES: Record = { + 'puck-wedge-light': require('../../../assets/navigation/puck-wedge-light.png'), + 'puck-wedge-dark': require('../../../assets/navigation/puck-wedge-dark.png'), + 'puck-dot-light': require('../../../assets/navigation/puck-dot-light.png'), + 'puck-dot-dark': require('../../../assets/navigation/puck-dot-dark.png'), + 'puck-retained-light': require('../../../assets/navigation/puck-retained-light.png'), + 'puck-retained-dark': require('../../../assets/navigation/puck-retained-dark.png'), +}; + +export const puckImage = (kind: PuckKind, scheme: ColorScheme) => `puck-${kind}-${scheme}`; + +/** Map-aligned heading; the icon faces the viewer so it stays legible under pitch. */ +export function puckLayout(image: string, heading: number): NonNullable { + return { + 'icon-image': image, 'icon-rotate': heading, 'icon-rotation-alignment': 'map', 'icon-pitch-alignment': 'viewport', + 'icon-allow-overlap': true, 'icon-ignore-placement': true, + }; +} diff --git a/src/features/map/useGuidanceCameraDriver.ts b/src/features/map/useGuidanceCameraDriver.ts new file mode 100644 index 0000000..7ad6638 --- /dev/null +++ b/src/features/map/useGuidanceCameraDriver.ts @@ -0,0 +1,80 @@ +import { useCallback, useEffect, useRef, type RefObject } from 'react'; +import type { CameraRef, MapRef } from '@maplibre/maplibre-react-native'; +import type { GuidanceMapState } from '../navigation/useGuidanceCamera'; +import type { CameraFrame } from '../navigation/guidance-camera'; +import { project } from '../navigation/map-projection'; + +/** Development-only screen assertions, read from the device log (`[nav-cam]`). */ +const ASSERT = typeof __DEV__ !== 'undefined' && __DEV__; + +/** + * Issues the guidance camera: one native ease per frame in follow, one fit per overview request, + * nothing in free. A gesture is reported at its start and blocks every pending move at once. + */ +export function useGuidanceCameraDriver({ guidance, loaded, camera, map, commands, size }: { + guidance: GuidanceMapState | null; loaded: boolean; camera: RefObject; map: RefObject; + commands: RefObject; size: RefObject<{ width: number; height: number }>; +}) { + const intent = guidance?.intent; + const frame = guidance?.frame ?? null; + const overview = guidance?.overview ?? null; + const issued = useRef(null); + const overviewIssued = useRef(null); + const gestureActive = useRef(false); + const latest = useRef(guidance); + latest.current = guidance; + useEffect(() => { if (intent !== 'free') gestureActive.current = false; }, [intent]); + useEffect(() => { + if (!loaded || !frame || intent !== 'follow' || gestureActive.current || issued.current === frame.key) return; + issued.current = frame.key; + commands.current += 1; + camera.current?.easeTo({ + center: [frame.center.longitude, frame.center.latitude], bearing: frame.bearing, pitch: frame.pitch, zoom: frame.zoom, + padding: frame.padding, duration: frame.durationMs, easing: frame.easing, + }); + if (ASSERT) assertFrame(map, frame, size.current); + }, [loaded, frame, intent, camera, map, commands, size]); + useEffect(() => { + if (!loaded || !overview || intent !== 'overview' || overviewIssued.current === overview.key) return; + overviewIssued.current = overview.key; + commands.current += 1; + camera.current?.fitBounds(overview.bounds, { padding: overview.padding, bearing: 0, pitch: 0, duration: 700 }); + }, [loaded, overview, intent, camera, commands]); + useEffect(() => { if (!guidance) { issued.current = null; overviewIssued.current = null; } }, [guidance]); + return useCallback(() => { + const current = latest.current; + if (!current) return; + gestureActive.current = true; + if (ASSERT) console.log(`[nav-cam] gesture intent=${current.intent} at=${Date.now()}`); + if (current.intent !== 'free') current.onUserGesture(); + }, []); +} + +/** + * Near the end of the move, compare MapLibre's own projection with the planned anchor and framing: + * the camera centre must land on the anchor, the junction and outgoing path inside the map. + */ +function assertFrame(map: RefObject, frame: CameraFrame, size: { width: number; height: number }) { + const issuedAt = Date.now(); + setTimeout(() => { + const ref = map.current; + if (!ref) return; + const puck: [number, number] = [frame.center.longitude, frame.center.latitude]; + const junction = frame.framing?.points[0]; + void Promise.all([ + ref.project(puck), ref.getZoom(), ref.getBearing(), ref.getPitch(), + junction ? ref.project([junction.longitude, junction.latitude]) : Promise.resolve(null), + ]).then(([screen, zoom, bearing, pitch, junctionScreen]) => { + const predicted = junction ? project(frame, size, junction) : null; + const row = { + key: frame.key.split(':')[0], dt: Date.now() - issuedAt, dur: frame.durationMs, anchorY: round(frame.anchor.y), puckY: round(screen[1]), puckX: round(screen[0]), + dyPct: round(100 * (screen[1] - frame.anchor.y) / size.height, 2), zoom: round(zoom, 2), zoomCmd: frame.zoom, bearing: round(bearing, 1), bearingCmd: round(frame.bearing, 1), + pitch: round(pitch, 1), lead: frame.leadMeters, framing: frame.framing?.maneuverId ?? null, + junction: junctionScreen ? [round(junctionScreen[0]), round(junctionScreen[1])] : null, + junctionPredicted: predicted ? [round(predicted.x), round(predicted.y)] : null, + }; + console.log(`[nav-cam] ${JSON.stringify(row)}`); + }).catch(() => undefined); + }, Math.max(0, frame.durationMs - 60)); +} +const round = (value: number, digits = 0) => Math.round(value * 10 ** digits) / 10 ** digits; diff --git a/src/features/map/useMapCamera.ts b/src/features/map/useMapCamera.ts index 6fc7caf..fdc271b 100644 --- a/src/features/map/useMapCamera.ts +++ b/src/features/map/useMapCamera.ts @@ -1,6 +1,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { Coordinate } from '../../domain/types'; +import { nextIntent, type CameraIntent, type CameraIntentEvent } from '../navigation/guidance-camera'; import { TURIN_OVERVIEW } from './coordinates'; import { createViewportStore, mayPersistSettledView } from './viewport-store'; @@ -18,6 +19,12 @@ export interface MapCamera { areaChanged: boolean; /** Guidance follows accepted positions until the user pans. */ following: boolean; + /** Guidance camera intent: follow, free (after a gesture) or overview. */ + guidanceIntent: CameraIntent; + /** Changes on every explicit Ricentra, so the camera issues exactly one transition. */ + guidanceRecenter: number; + /** Changes on every explicit overview request; the remaining route is framed once per value. */ + guidanceOverview: number; /** Changes when the user asks to frame the planning route again. */ frameRevision: number; /** The launch overview, a restored view, a fix, or a view the user chose. */ @@ -38,9 +45,12 @@ export interface MapCamera { userMoved(coordinate: Coordinate, zoom?: number): void; /** Any settled camera move reported by the map outside guidance, including fits and animations. */ viewSettled(coordinate: Coordinate, zoom?: number): void; + /** A guidance-map gesture began: enter free immediately and keep it until Ricentra. */ stopFollowing(): void; follow(): void; recenterGuidance(): void; + /** Frame the remaining route north-up and flat, once. */ + overviewGuidance(): void; frameRoute(): void; /** Forgets the stored last view; the next launch without a fix opens on the overview. */ forgetLastView(): Promise; @@ -66,7 +76,10 @@ export function useMapCamera(): MapCamera { const [searchCenter, setSearchCenterState] = useState(TURIN_OVERVIEW.center); const searchCenterRef = useRef(TURIN_OVERVIEW.center); const [areaChanged, setAreaChanged] = useState(false); - const [following, setFollowing] = useState(true); + const [guidanceIntent, setGuidanceIntent] = useState('follow'); + const [guidanceRecenter, setGuidanceRecenter] = useState(0); + const [guidanceOverview, setGuidanceOverview] = useState(0); + const intentEvent = useCallback((event: CameraIntentEvent) => setGuidanceIntent(current => nextIntent(current, event)), []); const [frameRevision, setFrameRevision] = useState(0); const [view, setView] = useState('overview'); const [viewCenter, setViewCenter] = useState(TURIN_OVERVIEW.center); @@ -137,11 +150,13 @@ export function useMapCamera(): MapCamera { // Programmatic fits are what the user last saw too; persist them once the user has engaged. if (mayPersistSettledView({ engaged: touched.current || located.current, forgotten: forgotten.current })) scheduleSave(); }, - stopFollowing: () => setFollowing(false), - follow: () => setFollowing(true), - recenterGuidance: () => { setFollowing(true); setRevision(value => value + 1); }, + stopFollowing: () => intentEvent('gesture'), + follow: () => intentEvent('reset'), + recenterGuidance: () => { intentEvent('recenter'); setGuidanceRecenter(value => value + 1); setRevision(value => value + 1); }, + overviewGuidance: () => { intentEvent('overview'); setGuidanceOverview(value => value + 1); }, frameRoute: () => setFrameRevision(value => value + 1), forgetLastView: () => { forgotten.current = true; clearTimeout(saveTimer.current); return viewportStore.clear(); }, - }), [setCenter, setCameraZoom, setSearchCenter, scheduleSave]); - return { center, zoom, revision, searchCenter, areaChanged, following, frameRevision, view, viewCenter, ...actions }; + }), [setCenter, setCameraZoom, setSearchCenter, scheduleSave, intentEvent]); + const following = guidanceIntent === 'follow'; + return { center, zoom, revision, searchCenter, areaChanged, following, guidanceIntent, guidanceRecenter, guidanceOverview, frameRevision, view, viewCenter, ...actions }; } diff --git a/src/features/navigation/NavigationPanel.tsx b/src/features/navigation/NavigationPanel.tsx index 87d06fa..ea17e48 100644 --- a/src/features/navigation/NavigationPanel.tsx +++ b/src/features/navigation/NavigationPanel.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { ActivityIndicator, Linking, Modal, Pressable, ScrollView, useWindowDimensions, View } from 'react-native'; import { Text } from '../../ui/Text'; import { useThemeColors } from '../../theme'; @@ -8,16 +8,22 @@ import { navigationLocationForReplan, navigationPresentation } from '../../domai import { Button, Display, Icon, IconButton, Notice, Num, useHairlines } from '../../ui'; import type { NavigationState } from './navigation-controller'; import { journeyDuration } from '../planner/journey-presentation'; +import type { CameraIntent } from './guidance-camera'; const distance = (meters: number) => meters < 1000 ? `${Math.round(meters)} m` : `${(meters / 1000).toFixed(1).replace('.', ',')} km`; -export function NavigationPanel({ snapshot, busy, error, following, onRecenter, onStop, onRetry, onMute, onConfirmTransit, onReplan }: NavigationState & { - following: boolean; onRecenter: () => void; onStop: () => void; onRetry: () => void; onMute: () => void; +export function NavigationPanel({ snapshot, busy, error, following, intent, onRecenter, onOverview, onChromeLayout, onStop, onRetry, onMute, onConfirmTransit, onReplan }: NavigationState & { + following: boolean; intent: CameraIntent; onRecenter: () => void; onOverview: () => void; + /** Heights of the top banner and bottom chrome, so the camera anchors the puck between them. */ + onChromeLayout: (top: number, bottom: number) => void; + onStop: () => void; onRetry: () => void; onMute: () => void; onConfirmTransit: (action: TransitConfirmation) => void; onReplan: () => void; }) { const colors = useThemeColors(); const hairlines = useHairlines(); const { width, height, fontScale } = useWindowDimensions(); const [detailsOpen, setDetailsOpen] = useState(false); + const banner = useRef(120); + const strip = useRef(190); const [now, setNow] = useState(Date.now()); const transitMode = snapshot.mode === 'transit'; const cues = snapshot.locationUsable === true; @@ -37,7 +43,7 @@ export function NavigationPanel({ snapshot, busy, error, following, onRecenter, const landscape = width >= 650 && height < 500; const panelHeight = Math.min(height * 0.46, Math.max(176, 176 * Math.min(fontScale, 1.5))); return - + { banner.current = event.nativeEvent.layout.height; onChromeLayout(banner.current, strip.current); }} style={{ height: Math.min(height * 0.3, 104 * Math.min(fontScale, 1.5)), ...(landscape ? { position: "absolute", top: 0, left: 0, right: 320 } as const : {}), backgroundColor: colors.chrome, ...hairlines.bottom }} className="px-4 py-3"> {waiting ? : } @@ -49,11 +55,17 @@ export function NavigationPanel({ snapshot, busy, error, following, onRecenter, - - + + + {intent !== 'follow' && snapshot.location ? + + Ricentra + + : null} - + { strip.current = event.nativeEvent.layout.height; onChromeLayout(banner.current, strip.current); }} style={[landscape ? { position: "absolute", right: 0, top: 0, bottom: 0, width: 320 } : { height: panelHeight }, hairlines.top]} className="rounded-t-3xl bg-surface"> {searching && text.signal ? {text.signal} : {!transit && snapshot.distanceRemainingMeters != null ? `${remainingSeconds != null ? journeyDuration(remainingSeconds) + ' · ' : ''}${distance(snapshot.distanceRemainingMeters)}` : transit ? `Tratta ${transit.legIndex + 1} di ${transit.legCount}` : 'Il tuo viaggio'}} diff --git a/src/features/navigation/guidance-camera.test.ts b/src/features/navigation/guidance-camera.test.ts index 961b6e1..2494507 100644 --- a/src/features/navigation/guidance-camera.test.ts +++ b/src/features/navigation/guidance-camera.test.ts @@ -177,3 +177,15 @@ test('"Poi" appears only when the following maneuver is within about ten seconds assert.ok(followsClosely({ ...near, afterUpcomingMeters: 400, afterUpcomingSeconds: 8 }, 9), 'by route time'); assert.ok(!followsClosely(undefined, 9)); }); + +test('providers without speed or course: kinematics are derived from consecutive fixes for presentation', () => { + const fixture = routeFixture([{ bearing: 300, meters: 600 }]); + const inputs = trajectory(fixture, { mode: 'car', speed: 10, seconds: 8, alignment: 'deviating' }).map(input => { + const { speedMps: _speed, course: _course, courseAccuracyDegrees: _accuracy, ...fix } = input.fix!; + return { ...input, fix }; + }); + const frames = run(inputs); + assert.equal(frames[0]!.puck.kind, 'dot', 'no direction before a second fix'); + assert.ok(Math.abs(angleDelta(frames[7]!.bearing, 300)) < 1); + assert.ok(frames[7]!.leadMeters > 5, 'derived speed allows the bounded lead'); +}); diff --git a/src/features/navigation/guidance-camera.ts b/src/features/navigation/guidance-camera.ts index 49d513d..e7ddb00 100644 --- a/src/features/navigation/guidance-camera.ts +++ b/src/features/navigation/guidance-camera.ts @@ -1,7 +1,7 @@ import type { Coordinate } from '../../domain/types'; import type { FollowingManeuver, GuidanceManeuver, NavigationFix, RouteProgress } from '../../domain/navigation'; import { inside, paddingForAnchor, project, type CameraPose, type Padding, type ScreenPoint, type VisibleRect } from './map-projection'; -import { angleDelta, distanceMeters, normalizeBearing, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, sliceRoute, type RouteMeasure } from './route-measure'; +import { angleDelta, bearingDegrees, distanceMeters, normalizeBearing, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, sliceRoute, type RouteMeasure } from './route-measure'; export type CameraMode = 'walk' | 'bicycle' | 'car'; @@ -40,19 +40,19 @@ export interface CameraProfile { const lerp = (a: number, b: number, t: number) => a + (b - a) * Math.min(1, Math.max(0, t)); export const CAMERA_PROFILES: Record = { walk: { - pitch: 30, cruiseZoom: () => 18.1, minZoom: 16.9, anchor: 0.67, anticipationSeconds: 8, outgoingMeters: 30, - courseSpeed: 0.8, holdSpeed: 0.35, typicalSpeed: 1.3, extrapolate: false, snapToRoute: false, routeLookAhead: 12, - bearingGain: 0.45, bearingDeadBand: 4, + pitch: 34, cruiseZoom: () => 18.3, minZoom: 16.9, anchor: 0.67, anticipationSeconds: 8, outgoingMeters: 30, + courseSpeed: 0.8, holdSpeed: 0.35, typicalSpeed: 1.3, extrapolate: false, snapToRoute: false, routeLookAhead: 20, + bearingGain: 0.5, bearingDeadBand: 4, }, bicycle: { pitch: 42, cruiseZoom: speed => lerp(18, 17.1, (speed - 3) / 5), minZoom: 16.6, anchor: 0.715, anticipationSeconds: 10, outgoingMeters: 45, courseSpeed: 1.6, holdSpeed: 0.8, typicalSpeed: 4.5, extrapolate: true, snapToRoute: true, - routeLookAhead: 20, bearingGain: 0.55, bearingDeadBand: 3, + routeLookAhead: 25, bearingGain: 0.55, bearingDeadBand: 3, }, car: { pitch: 48, cruiseZoom: speed => lerp(17.7, 15.7, (speed - 6) / 19), minZoom: 15.4, anchor: 0.735, anticipationSeconds: 12, outgoingMeters: 70, courseSpeed: 2.5, holdSpeed: 1.2, typicalSpeed: 9, extrapolate: true, snapToRoute: true, - routeLookAhead: 30, bearingGain: 0.6, bearingDeadBand: 2.5, + routeLookAhead: 35, bearingGain: 0.6, bearingDeadBand: 2.5, }, }; @@ -134,6 +134,8 @@ export class GuidanceCamera { private mode: CameraMode | null = null; private viewportKey = ''; private recenters = 0; + private previousFix: { coordinate: Coordinate; ms: number } | null = null; + private derived: DerivedKinematics = {}; get current() { return this.frame; } get expectedIntervalMs() { return this.intervals.length ? Math.min(2000, Math.max(600, median(this.intervals))) : 1000; } @@ -146,10 +148,33 @@ export class GuidanceCamera { return this.frame; } + /** + * Some providers omit speed and course. For presentation only, derive them from the previous + * distinct accepted fix (0.5–3 s earlier); a move smaller than the fix noise yields no course. + */ + private withKinematics(fix: NavigationFix): NavigationFix { + const ms = fix.elapsedMs ?? fix.timestamp; + const coordinate = { latitude: fix.latitude, longitude: fix.longitude }; + const previous = this.previousFix; + if (previous && ms === previous.ms) return { ...fix, ...this.derived }; + this.previousFix = { coordinate, ms }; + this.derived = {}; + if (!previous || (fix.speedMps !== undefined && fix.course !== undefined)) return fix; + const seconds = (ms - previous.ms) / 1000; + if (seconds < 0.5 || seconds > 3) return fix; + const moved = distanceMeters(previous.coordinate, coordinate); + if (fix.speedMps === undefined) this.derived.speedMps = moved / seconds; + if (fix.course === undefined && moved >= Math.max(1, 0.25 * fix.accuracyMeters)) { + this.derived.course = bearingDegrees(previous.coordinate, coordinate); + this.derived.courseAccuracyDegrees = 20; + } + return { ...fix, ...this.derived }; + } + update(input: CameraInput): CameraFrame | null { const profile = CAMERA_PROFILES[input.mode]; - const fix = input.fix; - if (!fix) return this.frame; + if (!input.fix) return this.frame; + const fix = this.withKinematics(input.fix); const fixMs = fix.elapsedMs ?? fix.timestamp; const viewportKey = `${input.viewport.width}x${input.viewport.height}:${input.viewport.top}:${input.viewport.bottom}`; const modeChanged = this.mode !== input.mode; @@ -275,6 +300,7 @@ export class GuidanceCamera { } } +export interface DerivedKinematics { speedMps?: number; course?: number; courseAccuracyDegrees?: number } const round = (value: number, digits: number) => Math.round(value * 10 ** digits) / 10 ** digits; /** At most `count` evenly spread points (always including both ends). */ function sample(points: Coordinate[], count: number): Coordinate[] { diff --git a/src/features/navigation/useGuidanceCamera.ts b/src/features/navigation/useGuidanceCamera.ts new file mode 100644 index 0000000..be0ffc0 --- /dev/null +++ b/src/features/navigation/useGuidanceCamera.ts @@ -0,0 +1,62 @@ +import { useMemo, useRef } from 'react'; +import type { NavigationSnapshot } from '../../domain/navigation'; +import type { MapCamera } from '../map/useMapCamera'; +import { GuidanceCamera, overviewBounds, type CameraFrame, type CameraIntent, type CameraMode, type GuidanceViewport } from './guidance-camera'; +import type { Padding } from './map-projection'; +import { measureRoute } from './route-measure'; + +export interface GuidanceOverview { key: number; bounds: [number, number, number, number]; padding: Padding } +/** What the map needs during guidance: the camera intent, the follow frame and an overview frame. */ +export interface GuidanceMapState { + intent: CameraIntent; + frame: CameraFrame | null; + overview: GuidanceOverview | null; + /** Called at gesture start: enters free immediately, before the region settles. */ + onUserGesture(): void; +} + +const ROAD_MODES = new Set(['walk', 'bicycle', 'car']); +/** Location states in which the accepted fix is current; anything else holds the camera. */ +const LIVE_STATUSES = new Set(['navigating', 'off-route', 'rerouting', 'routing']); + +/** + * First-person guidance camera, driven only by accepted native navigation state (no second + * location stream, no MapLibre auto-tracking). One planner per session; one frame per distinct fix. + */ +export function useGuidanceCamera({ snapshot, camera, viewport, active }: { + snapshot: NavigationSnapshot; camera: MapCamera; viewport: GuidanceViewport; active: boolean; +}): GuidanceMapState | null { + const planner = useRef<{ session: string | null; camera: GuidanceCamera; recenter: number } | null>(null); + const mode = snapshot.mode && ROAD_MODES.has(snapshot.mode) ? snapshot.mode as CameraMode : null; + if (!planner.current || planner.current.session !== snapshot.sessionId) { + planner.current = { session: snapshot.sessionId, camera: new GuidanceCamera(), recenter: camera.guidanceRecenter }; + } + const geometry = snapshot.route?.geometry; + const route = useMemo(() => geometry && geometry.length > 1 ? measureRoute(geometry) : null, [geometry]); + const usable = snapshot.locationUsable === true && LIVE_STATUSES.has(snapshot.status); + const state = planner.current; + let frame: CameraFrame | null = null; + if (active && mode && snapshot.location) { + frame = state.camera.update({ + mode, fix: snapshot.location, usable, route, routeRevision: snapshot.routeRevision, + progress: snapshot.routeProgress, alignment: snapshot.alignment, snapped: snapshot.snappedLocation, + upcoming: snapshot.upcomingManeuver, following: snapshot.followingManeuver, + distanceToManeuverMeters: snapshot.distanceToManeuverMeters, viewport, + }); + if (camera.guidanceRecenter !== state.recenter) { state.recenter = camera.guidanceRecenter; frame = state.camera.recenter() ?? frame; } + } + const overviewKey = camera.guidanceOverview; + const traveled = snapshot.routeProgress?.traveledMeters ?? 0; + const location = snapshot.location; + // Framed once per explicit request: later progress or a reroute never refits it. + const overview = useMemo(() => { + if (!route || overviewKey === 0) return null; + const bounds = overviewBounds(route, traveled, location ? { latitude: location.latitude, longitude: location.longitude } : undefined); + if (!bounds) return null; + return { key: overviewKey, bounds, padding: { top: viewport.top + 24, right: 32, bottom: viewport.height - viewport.bottom + 24, left: 32 } }; + // eslint-disable-next-line react-hooks/exhaustive-deps -- deliberately frozen until the next request + }, [overviewKey, route]); + const { stopFollowing } = camera; + if (!active || !mode) return null; + return { intent: camera.guidanceIntent, frame, overview, onUserGesture: stopFollowing }; +} From dbe2770749ad79e77ade3f42ba3402e951fd82b1 Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli <27171200+fcastrovilli@users.noreply.github.com> Date: Mon, 2 Nov 2026 10:15:20 +0100 Subject: [PATCH 3/5] Add the first-person guidance screen: maneuver banner, compact strip, route split and turn arrow Banner: original maneuver glyphs from the OSRM type/modifier (straight, slight/normal/sharp turns, U-turn, fork, merge, ramps, roundabouts with exit number and circulation, arrival; unknown maneuvers keep a neutral glyph with the supplied text), the distance in heavy Mona Sans with a smaller unit, street and action in Geist with two lines reserved, and a reserved row for 'Poi ...' (only when the following maneuver is within about ten seconds of travel) or status (rerouting, off route, reduced precision, paused with the last instruction). No state changes the banner or strip height, so the camera anchor never jumps. Strip: arrival labelled as an estimate without traffic, remaining time and distance, distinct voice states, overview and Interrompi; the summary opens details; problems and Retry float above the strip; a paused position shows 'Stima sospesa' instead of an apparently current ETA. Map: muted travelled route under the active remaining line (cut by the native progress through line-gradient), one cased arrow through the next junction from the real geometry, generic business labels hidden while driving or cycling, one-way chevrons while driving (a hidden brand basemap layer adopted under an app source so live theme switches keep it). Transit access/transfer/final walks use the walking camera when a usable fix exists and otherwise frame the current leg. Leaving guidance returns the browsing map to north-up and flat. --- assets/navigation/arrowhead-dark.png | Bin 0 -> 812 bytes assets/navigation/arrowhead-dark@2x.png | Bin 0 -> 1457 bytes assets/navigation/arrowhead-dark@3x.png | Bin 0 -> 2173 bytes assets/navigation/arrowhead-light.png | Bin 0 -> 994 bytes assets/navigation/arrowhead-light@2x.png | Bin 0 -> 1595 bytes assets/navigation/arrowhead-light@3x.png | Bin 0 -> 2188 bytes assets/navigation/maneuver-arrive-left.png | Bin 0 -> 676 bytes assets/navigation/maneuver-arrive-left@2x.png | Bin 0 -> 1416 bytes assets/navigation/maneuver-arrive-left@3x.png | Bin 0 -> 2122 bytes assets/navigation/maneuver-arrive.png | Bin 0 -> 683 bytes assets/navigation/maneuver-arrive@2x.png | Bin 0 -> 1354 bytes assets/navigation/maneuver-arrive@3x.png | Bin 0 -> 2182 bytes assets/navigation/maneuver-fork-left.png | Bin 0 -> 751 bytes assets/navigation/maneuver-fork-left@2x.png | Bin 0 -> 1492 bytes assets/navigation/maneuver-fork-left@3x.png | Bin 0 -> 2281 bytes assets/navigation/maneuver-left.png | Bin 0 -> 507 bytes assets/navigation/maneuver-left@2x.png | Bin 0 -> 990 bytes assets/navigation/maneuver-left@3x.png | Bin 0 -> 1512 bytes assets/navigation/maneuver-merge-left.png | Bin 0 -> 666 bytes assets/navigation/maneuver-merge-left@2x.png | Bin 0 -> 1345 bytes assets/navigation/maneuver-merge-left@3x.png | Bin 0 -> 2139 bytes assets/navigation/maneuver-ramp-left.png | Bin 0 -> 543 bytes assets/navigation/maneuver-ramp-left@2x.png | Bin 0 -> 1042 bytes assets/navigation/maneuver-ramp-left@3x.png | Bin 0 -> 1737 bytes .../navigation/maneuver-roundabout-left.png | Bin 0 -> 774 bytes .../maneuver-roundabout-left@2x.png | Bin 0 -> 1578 bytes .../maneuver-roundabout-left@3x.png | Bin 0 -> 2519 bytes .../navigation/maneuver-roundabout-right.png | Bin 0 -> 714 bytes .../maneuver-roundabout-right@2x.png | Bin 0 -> 1481 bytes .../maneuver-roundabout-right@3x.png | Bin 0 -> 2461 bytes .../maneuver-roundabout-sharp-left.png | Bin 0 -> 780 bytes .../maneuver-roundabout-sharp-left@2x.png | Bin 0 -> 1530 bytes .../maneuver-roundabout-sharp-left@3x.png | Bin 0 -> 2494 bytes .../maneuver-roundabout-slight-left.png | Bin 0 -> 769 bytes .../maneuver-roundabout-slight-left@2x.png | Bin 0 -> 1503 bytes .../maneuver-roundabout-slight-left@3x.png | Bin 0 -> 2439 bytes .../maneuver-roundabout-slight-right.png | Bin 0 -> 747 bytes .../maneuver-roundabout-slight-right@2x.png | Bin 0 -> 1511 bytes .../maneuver-roundabout-slight-right@3x.png | Bin 0 -> 2440 bytes .../maneuver-roundabout-straight.png | Bin 0 -> 767 bytes .../maneuver-roundabout-straight@2x.png | Bin 0 -> 1472 bytes .../maneuver-roundabout-straight@3x.png | Bin 0 -> 2449 bytes .../navigation/maneuver-roundabout-uturn.png | Bin 0 -> 757 bytes .../maneuver-roundabout-uturn@2x.png | Bin 0 -> 1490 bytes .../maneuver-roundabout-uturn@3x.png | Bin 0 -> 2460 bytes assets/navigation/maneuver-sharp-left.png | Bin 0 -> 585 bytes assets/navigation/maneuver-sharp-left@2x.png | Bin 0 -> 1127 bytes assets/navigation/maneuver-sharp-left@3x.png | Bin 0 -> 1835 bytes assets/navigation/maneuver-slight-left.png | Bin 0 -> 577 bytes assets/navigation/maneuver-slight-left@2x.png | Bin 0 -> 1072 bytes assets/navigation/maneuver-slight-left@3x.png | Bin 0 -> 1737 bytes assets/navigation/maneuver-straight.png | Bin 0 -> 381 bytes assets/navigation/maneuver-straight@2x.png | Bin 0 -> 747 bytes assets/navigation/maneuver-straight@3x.png | Bin 0 -> 1227 bytes assets/navigation/maneuver-unknown.png | Bin 0 -> 906 bytes assets/navigation/maneuver-unknown@2x.png | Bin 0 -> 1798 bytes assets/navigation/maneuver-unknown@3x.png | Bin 0 -> 2757 bytes assets/navigation/maneuver-uturn-left.png | Bin 0 -> 666 bytes assets/navigation/maneuver-uturn-left@2x.png | Bin 0 -> 1287 bytes assets/navigation/maneuver-uturn-left@3x.png | Bin 0 -> 2003 bytes assets/navigation/oneway-dark.png | Bin 0 -> 239 bytes assets/navigation/oneway-dark@2x.png | Bin 0 -> 399 bytes assets/navigation/oneway-dark@3x.png | Bin 0 -> 549 bytes assets/navigation/oneway-light.png | Bin 0 -> 247 bytes assets/navigation/oneway-light@2x.png | Bin 0 -> 396 bytes assets/navigation/oneway-light@3x.png | Bin 0 -> 547 bytes docs/development/navigation.md | 14 ++ docs/development/ux.md | 8 +- src/features/app/AppMap.tsx | 2 +- src/features/app/AppShell.tsx | 6 +- src/features/map/GuidanceMapLayers.tsx | 65 ++++++ src/features/map/MapCanvas.native.tsx | 16 +- src/features/map/guidance-puck.ts | 4 + src/features/map/useGuidanceCameraDriver.ts | 20 +- .../navigation/ManeuverGlyphImage.tsx | 37 ++++ src/features/navigation/NavigationPanel.tsx | 209 +++++++++++------- .../navigation/TransitFollowPanel.tsx | 11 +- src/features/navigation/guidance-camera.ts | 4 +- .../navigation/guidance-route.test.ts | 39 ++++ src/features/navigation/guidance-route.ts | 51 +++++ .../navigation/maneuver-presentation.test.ts | 61 +++++ .../navigation/maneuver-presentation.ts | 102 +++++++++ src/features/navigation/useGuidanceCamera.ts | 97 ++++++-- src/theme/brand-assets.test.ts | 6 + src/theme/brand-basemap.ts | 12 + src/theme/map-style.test.ts | 4 +- src/theme/palette.ts | 4 + 87 files changed, 654 insertions(+), 118 deletions(-) create mode 100644 assets/navigation/arrowhead-dark.png create mode 100644 assets/navigation/arrowhead-dark@2x.png create mode 100644 assets/navigation/arrowhead-dark@3x.png create mode 100644 assets/navigation/arrowhead-light.png create mode 100644 assets/navigation/arrowhead-light@2x.png create mode 100644 assets/navigation/arrowhead-light@3x.png create mode 100644 assets/navigation/maneuver-arrive-left.png create mode 100644 assets/navigation/maneuver-arrive-left@2x.png create mode 100644 assets/navigation/maneuver-arrive-left@3x.png create mode 100644 assets/navigation/maneuver-arrive.png create mode 100644 assets/navigation/maneuver-arrive@2x.png create mode 100644 assets/navigation/maneuver-arrive@3x.png create mode 100644 assets/navigation/maneuver-fork-left.png create mode 100644 assets/navigation/maneuver-fork-left@2x.png create mode 100644 assets/navigation/maneuver-fork-left@3x.png create mode 100644 assets/navigation/maneuver-left.png create mode 100644 assets/navigation/maneuver-left@2x.png create mode 100644 assets/navigation/maneuver-left@3x.png create mode 100644 assets/navigation/maneuver-merge-left.png create mode 100644 assets/navigation/maneuver-merge-left@2x.png create mode 100644 assets/navigation/maneuver-merge-left@3x.png create mode 100644 assets/navigation/maneuver-ramp-left.png create mode 100644 assets/navigation/maneuver-ramp-left@2x.png create mode 100644 assets/navigation/maneuver-ramp-left@3x.png create mode 100644 assets/navigation/maneuver-roundabout-left.png create mode 100644 assets/navigation/maneuver-roundabout-left@2x.png create mode 100644 assets/navigation/maneuver-roundabout-left@3x.png create mode 100644 assets/navigation/maneuver-roundabout-right.png create mode 100644 assets/navigation/maneuver-roundabout-right@2x.png create mode 100644 assets/navigation/maneuver-roundabout-right@3x.png create mode 100644 assets/navigation/maneuver-roundabout-sharp-left.png create mode 100644 assets/navigation/maneuver-roundabout-sharp-left@2x.png create mode 100644 assets/navigation/maneuver-roundabout-sharp-left@3x.png create mode 100644 assets/navigation/maneuver-roundabout-slight-left.png create mode 100644 assets/navigation/maneuver-roundabout-slight-left@2x.png create mode 100644 assets/navigation/maneuver-roundabout-slight-left@3x.png create mode 100644 assets/navigation/maneuver-roundabout-slight-right.png create mode 100644 assets/navigation/maneuver-roundabout-slight-right@2x.png create mode 100644 assets/navigation/maneuver-roundabout-slight-right@3x.png create mode 100644 assets/navigation/maneuver-roundabout-straight.png create mode 100644 assets/navigation/maneuver-roundabout-straight@2x.png create mode 100644 assets/navigation/maneuver-roundabout-straight@3x.png create mode 100644 assets/navigation/maneuver-roundabout-uturn.png create mode 100644 assets/navigation/maneuver-roundabout-uturn@2x.png create mode 100644 assets/navigation/maneuver-roundabout-uturn@3x.png create mode 100644 assets/navigation/maneuver-sharp-left.png create mode 100644 assets/navigation/maneuver-sharp-left@2x.png create mode 100644 assets/navigation/maneuver-sharp-left@3x.png create mode 100644 assets/navigation/maneuver-slight-left.png create mode 100644 assets/navigation/maneuver-slight-left@2x.png create mode 100644 assets/navigation/maneuver-slight-left@3x.png create mode 100644 assets/navigation/maneuver-straight.png create mode 100644 assets/navigation/maneuver-straight@2x.png create mode 100644 assets/navigation/maneuver-straight@3x.png create mode 100644 assets/navigation/maneuver-unknown.png create mode 100644 assets/navigation/maneuver-unknown@2x.png create mode 100644 assets/navigation/maneuver-unknown@3x.png create mode 100644 assets/navigation/maneuver-uturn-left.png create mode 100644 assets/navigation/maneuver-uturn-left@2x.png create mode 100644 assets/navigation/maneuver-uturn-left@3x.png create mode 100644 assets/navigation/oneway-dark.png create mode 100644 assets/navigation/oneway-dark@2x.png create mode 100644 assets/navigation/oneway-dark@3x.png create mode 100644 assets/navigation/oneway-light.png create mode 100644 assets/navigation/oneway-light@2x.png create mode 100644 assets/navigation/oneway-light@3x.png create mode 100644 src/features/map/GuidanceMapLayers.tsx create mode 100644 src/features/navigation/ManeuverGlyphImage.tsx create mode 100644 src/features/navigation/guidance-route.test.ts create mode 100644 src/features/navigation/guidance-route.ts create mode 100644 src/features/navigation/maneuver-presentation.test.ts create mode 100644 src/features/navigation/maneuver-presentation.ts diff --git a/assets/navigation/arrowhead-dark.png b/assets/navigation/arrowhead-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..23a5c065655b866dc5c59da14219822c8b6b4095 GIT binary patch literal 812 zcmV+{1JnG8P)Nkl96ot>Nz;wW-0sc@k~+( zu*=BIYW3vU087lhy}e=5$;kj5HpPHJ{HJNqL^@@$r#SWNK!mI?_1+ z#hsef>*eJ|S(a&+x~_G8e$FV8TF18R6Cf-xM>;z@(_*n;^g%|T=jUfekvRdz__uTl zK=Dj!+V0`uK}AuhjjF12d3nhwGO`YB*)_l`HVkby91i8ZR~yc`xHFr!tO+o}4`S#b z6fY#*qu6$3S?UlazxQd&g8?X>V6Vu9whOCYuh;y!pCn1*E^OM;i&usadvE$KKq)nC zcXf58if7z~f_LQp{+>}}YG$SOur~n3oto7rZEg1*VHZwMPZ`C-DeQt*3x@(!k}i=( zqmk;mRv$6~@3iHEnH6fGH2}pkscE~Xr>A(*9YZ)NFD@<^MZzvD@K5Xu5Q=AlG)?8b zR~ybb1^j{Em&+xiNKJqd{s}{$pm>fwqSm$xZ+Tc%!Hbqd&BTVK1RzY0B!LUoy}(3qx<&umTx0d+i6Qf5sD|+5(SUN!)jZ2 zLKTzD@h#k+V}+y(^ocKXtx;;5!)Z4_rA^zlutGCb{k?G?%#&b+qzM|JHtv`w{N4oM zCZ}fgyS$+}nsM<0?+x<~u?fo23ECw!Gv5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Wq(XS{GVgL)gGK`^*McU{L9m_RinBqC!3t)+P9nKT7nNHLIj3?4&Wn7^{ zNf}QM&*4xGP8LhWwpW1{ln8O6R4u^Ryf!N$QjHtu7WeM2w&+j>CkU`5GOx-6SmKA#20uE&9#9!S(HPk>U*R7HV-Bz(8lekR##hEX#@Eyd;1wl8 z{J;YL-@*9%Sfq{4&@T1{5MT>*j^21eHq(jzA*dzNW@TKVH(pSmT2}ZPhjQ?b0TyY) zlrN|HhoK&?O%R5y-W8rv2;kKC3;>-pp8=qg<}(0v(tHMhPMZG!h9!hww7-o400000 LNkvXXu0mjf)o8Gq literal 0 HcmV?d00001 diff --git a/assets/navigation/arrowhead-dark@3x.png b/assets/navigation/arrowhead-dark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..234f099e371b694eedb2835a5db27b50e74bcf17 GIT binary patch literal 2173 zcma)8X*|?x8~$6yGLmgZa!}c_Bq1{92+i0U%giuRs3~H^a2Q+J#e2qBewJfx#!fgA zVLFwq(6MAN(ZOU%I+8s*6X##&eZRjSp6C8@|L*0w?)!S4M68{qC{z{-0D!2q6&ep( z;`bvY0NyjXp@sk;gtkVTIfl`f@>2+$Ug?B^Dj+m101^vL)1+1bI5R7V1l&}E>dIpW zp+cvfri=L;%qBw@cOEsPm3o*_uUEdf_%t;6y-OGx(_vKiAVm4sunp9j+jc6EIzqs`5tq`}rvkP;}VmvsR|sD2_cg zO1>C((P;?BZbh=7uu#QXa#!93a>68PR;^o;$8{Pf;Re7=;OV{dKR@U%Q-kg@;!O(* z3Jj}fEeMoEY9)x1)FK2Sy!!D^vAlsfxo`b}&wjHnychuMOzMW5s##OR!bJJggl$Ek zx(vInaP8ZMa~@6C0vvl7)t-{Vw33(^U+s zYIYL&>uhreLDZXy=RDa|GwMC0CjD$_~glq|VKLKODUIFVp?m*aN>!Bd4@hXzjX<*0! z4Qf5;s0lVuH5ugQ=0;YiX-YJ1508kLt<1=)mS!uV`0HNL`3)$hd=F7hqMNa)Z-7@F`z@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ID%HpYHyYl*$@x6x&UJ>o`haByC`_J~$q#o^t=o7n;&3yL?pN-Sy z4O3WH{Ehrx12^|XU*_YrbYR#QL`bxwF8`Bck#0=-@^L)7nzk;Oc=}+WxxuA&V=H{ri^$`?06k;G84)&8ybQ{3rohK)eeMqXRs-mT(1*jNx zbq%z-x(Y>Pq%3tC!0cx+`zAM|W2oisT)1*N|%bs4Z&tedh-|f8*AinIM8~TKp;Ssm3RM^rC8RpISE8s ztkwcgG#Y&msgxZ@ItB-alwkCfWm*GBJp0K>WE0ZKWyiBe6CP88oCZs;jG@^pjYY^dTG$c}N3I1My|o*w{!jGoPW1)6(*g=I7_3 zI3djyp^)?gG678k@n`++?oQgWW77S-wDcAfqg|E)k$}Zg&?L*zSxBYiIO4&##H_wz z!glcDu1!_c?da5`#;UgAu~i91b7(AXP3Iz;U~en{w9g?(V1^Zf$MT=;$a8 zo_WQD7W`Y6tC708y40&XgadI2tlXPW zD9C?5H-LB4v;G1&J;aQBLYRlO%0~}YtG!&7BR%M?2`f{GCKXJESHZ7gKzxToui2dA zlK>j74Enc6B4Hq)$07*qoM6N<$g5OHZtN;K2 literal 0 HcmV?d00001 diff --git a/assets/navigation/arrowhead-light@2x.png b/assets/navigation/arrowhead-light@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..43d9a6588b0e104b9390a2bea80c153d0799dc37 GIT binary patch literal 1595 zcmV-B2E_S^P)ju>m99Xj3+HW0Sh5F6g2zbRkJ~(=kda zZp1K+x+;-G+zB=#7%Xub8XD7u zf>^u1i7|3FpI;f2gh^ZgHouMCU%)Mcqo7fcl>|v#fcpBTzeNhi#St^Ly1IMFhLZY!Htbr1#l~SSFZeQ*>*-oezmNWR4U%G z7^?uZysv0^J8_E~Jb2LBeU1iqTM+726uf==mb)!zk!NXnq?Ax23?(S}R z`0xRqH)qeDlT0Rqw*>-dbEHv_l?aJk01{uC#CHML#{B%h#j@vxmc@>a&++V#5bx$A zo*6_cK#;QMg_cCMQc|gC%VMMgIKAs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~K+u;~q^|i%&P}!z@3%D+FU}bREAq zfkWOf5~)b=+jv!rdNR)RYvyjFx;`QD`e6-A{#W=Us?GnMEA(ZIk~g5)V#n=*zST~*=nV# zBX3-mVq3`{De3u7)Vso0G<5&4rB%L&PHSo!PT5&tkisX4R1wMln7BK?uLDiIxHaOF zi*Say?=G*e_ciRrALsv#CIEXlw5l_RbOZDgE==uz>^6FSJ1VBN1)|cu(ex&TN~PB2 z^_9yQ(9h8Uu|pxT!x>17*VI7e!&BPOz3$uu-PEu%8RvvH-{?ne;~RR1x-^R%DLKYv z#)>KHsjgqtO_6oVEcvf?aDt0BZ`}PJDRcgHNKDp*^~w2Ap*rPA(k4>DV!AHlDWuiZ zA-XrACKzXD7z3|nYmn!%4Ffxq-L^YK@9d#AWIIHr-}7BGvSls$Wlp@)Cb-D*#+^d^ zNT!u0s2s)acrcd+l6G*c1?hpMM}R)rmvlRy;dqjR5iv9Jt#^0{PVAot2bC#@^&1xiWxo_9N(Zo_FhsKe($8S0Acg3f?|20tZJxF89P1JqzwG@HzAc(P>99= zFB6q7oZFk$w5}-aR%iq^9ko%3^CfbrX8+IVehlQ9fuC6Ze`=AUnmb#9iT5FJwhX|` L*c#tt=o$Yn7@Y23 literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-arrive-left.png b/assets/navigation/maneuver-arrive-left.png new file mode 100644 index 0000000000000000000000000000000000000000..6793f9171a75070e41dd2a0e0087d6bcdf2289cc GIT binary patch literal 676 zcmV;V0$crwP)gQNnE3M^Lu9mE}&Z-cB{B-zCF<;fZ&|8~Xr3iXUNgt8(nR?I}j0RxH40}X<77T3g0i07{E7a$L zb2hm5l#;%qn5CT&Vqbt#!$CI;y2GEK=TgA2Uuxl4rQw}eTDu_id+a@md7yrUpTxcZ zm3oUXr0ea~Yl|KeYFjL(wzf_wNP352ewbOQ6X}+UVbDDm|59s)6u8$eCH+J(7t}Yn z*Bfk(c05qK!o3zWQGo6rh1#VK2UuYR+VMc`3in!2q5zeiACV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`tSvDb+eOXhI?n#AP2+Z2vuTwn@XgJ9PtA@1lgW`Kn8#z;<2hW5?xqo~eG)Fe7Um zK>&ubwG7GK-jg*1k6!O_I3?Z*Vz~=-iZ*t25?hj;waYoRPC_jEHZf6I$?{D9wKh=x zhaA}{jzrSO)!Qo1B?fhdG4^8NJnyNa)ymKQ!@rF~2*A%;DCQ#)7oNBk9#j-P zEXo`QD}%PEbjBFx+5>Lzm)}M0KK{db<2uUlHWZ67W>`}z43!GUm?>JyMCDVPzLC#={tHC)Zf7?NTwaw1&haIEGZrc{}4`?yUfkw*SVC zF)QDz3b*(LR5xAVoaGY`_v_A+o&28W4V+$T9lIHQ1lU%D7&HFOtC`3%W5xCBB1?D8 z|MIflVp~aFjjq75a6hertf0o=%h`=ztL6&MH<)g6q%mvSq-POcvt~uQerrlJsrz`| z;uuf-qC?ex?zvBV!BqFtT_%a6SVw1*O9n4y2rCfqjPDE;3&o@vT3C+zYcCdm>i- z<$kH$JteF0caf*P!C^IRnSyv%wu>tpnp5*iek?!YvX#3e=E2mg+dH<_{|r9l*w~{H zsxRKGJu`TLQuE800}s7*w$@MiH%*jpm)`phtp^`ey;|)%S)Uo6wqC?-QPa8cJ5PL4 z>-Tdvp33eOx$&U8=Y#aVqiXv MUHx3vIVCg!0159ec>n+a literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-arrive@2x.png b/assets/navigation/maneuver-arrive@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..18be92d0479027d7acee3c3484bb0a2ad6cb80e1 GIT binary patch literal 1354 zcmcgsX;Tsi00lz8D@7_1Qpv{kT zwa_WEXRQ*}4;LID6PIE5G)f3fCs&2a8Gd7E(I0p^@l&-TPti~{7(u%s(hje>pK zZ^S!Zd>4{w>p|Z>xr6-L768{$r zV&2%;ScadoR2*uKeg3HGV0l?(i#dWMk)@~VL*gT|;0Edbb7Wr+YT8SK&rv5=yD(>I zflM05l;TA`*dT?IYAX1JeOUE3W(-cDXuzO=cHQzWsoMc>^j8<_CSt@k5ON*254+2y zd6p*r!C7T||2x-b|I6!vidRfFMC~58(kGLmxK1y@fop=K>qw+>n9xH6s0WqZWJ#Y& zXs4Yr48-uz+)nvS6?-yDSH~Q&on=Ku-%h~wSX)1#LY$#@`@>=k(lJ)OGCfrl6#oofU<_sD`!y4Qui0v84 z!)Hho$I#V;7C60dp{^9GNc>m{e%sfR?_Q+a1Mf%O^BnNn`nmweWni2yOkG5v- z&2(WvB;)>{Ckrk_+4wZ&Uo7X(cbD$a3U;#P7RlgDaUmk0pP@>ib7>1#a_?$!Z~KX( zr}UhpnzdUM-SU;*q)u%(=Y!1&>7jD}8Nkk!+F5Eaf`Iv2>0=G@PGQ>W)Z|f#2i@WD z8>TxMkpb^y!{(Pr>Mp{pbg}8C^K$M(2Z4+gD8lCcRG1hf8eAN1TM+n(931BUwv0De z<5)iH)xhWCRIxrqNO;dZ{N+rech{P06orW-N1t#?sY+|a;Yo9&4HHINod#h^%L&{A zp4P4GS-;b+WgN(U3SWLwKTmALe@3RuZ!he?_M}EMtyy4ih3(opShch8*f8gr*c?&T zvDifLw_lvwaKrZGqZ56XhS*aj(=er8egl??sh98Ygg{WHk;nZs-WKaqvv(4MMtBTD zINMLfzjE_e%d^_JpfSWhvzmwO02Lp6mC;MKpIkkzaGZ*W3RoI_1o8!!E$Bp7C1jfj)$KP){G)2jsL#rX3SDYorhP0?R|JgI8B8j6~rHR98bb l=r@eV_e1i7q{Kj1q2nhri`(PQKH2<80417EY>i?G{sld$SEv90 literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-arrive@3x.png b/assets/navigation/maneuver-arrive@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9e7f45404e4dfc47b456230ef458c71a9f43a3ee GIT binary patch literal 2182 zcmds3`B&207AKTYka7kyjSwwMQ8FrWLPe255w!tDE48RBH5*Mcp)AcI5UnI7GApyL zrfETwR#YmICvjPp=FF(($8`J%UdaXvD9MbkIz_yD~^W4N#@x`HL9GYDwK) zjH3x}N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89wwW}g`>WKV~^Bc~(k!(i4tPyx@xMb{R9_*mQyN=YCTn9~A zl?@^xYIXG1%uv>zMt)|4FPTPkV{6=&ShHV6_yZlArIvX}2!)7`y2hj;$Z^Vyg5z}h z>sG;S(h_V)&{?6|Llr~vG#SeUqFOz62np(jo2?G;;!+-iA%c?Jsk^2~EX9(V>XO)y z`v3w%v%C*u-P8Fldj{_fA8H7ff(-LiZpn+(_-?rF#KvPECOrX@i8@f_zO%f(YWakA z?j(#H5^xghJs|G6HAA2D2mF4;^GD_&R32pmP}`UFr)>j3>9B({1xM4373}k9rq_?` zPS~+-b}?j{)R|+FKeequi?(zLCJ(bgH1&rvNaMTb9b079`)w~s&qq4uap#gat=_%C zJuP)nxR_(DQcp@z#U!Zy0jy^1sy*jxdNSs^7ES<<0@Q^EXb(;Rh!12#4_HnDka*3iSU6QYay%B^DKNsU(7{?^1h!Ye~s|0ay7WPI)#7baoSFLZW!M?Y&SB zg&Z0_K>H#>xnY!iOS^N(wJBut>G`nz_qDptfN}ch09y<}jt)D8H34h(cFRaDF7&G0 zwv$En`7#%KTEQ5p*p^`9eyPejTESK}JJAYur7%paeS?CUnLpk4ZLEDc!`_Dn{udys Lw?Dbeb2tBA>L<-+ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-fork-left.png b/assets/navigation/maneuver-fork-left.png new file mode 100644 index 0000000000000000000000000000000000000000..074deead3e84926fe73026b3fd99a993a99b9ada GIT binary patch literal 751 zcmVU9&z)~tHgXqG7_dj|VVsabYh2&uaqgRz4POPe zg<-LRaSrhdMr6Ke*)Zq@O0Cl?D6mC@7{5217-Q<<8Se!YO7vy%Q|yT;3oKF= zuu&Fppe$gcEZ{&{z(!fXfwF*&vVa3c73dLrIFJ4(qCtA4r~-9a{BG^KN%5tJD}@wL hewApU5)?7K@)PxUOF$NK)~x^l002ovPDHLkV1j!PNS*)y literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-fork-left@2x.png b/assets/navigation/maneuver-fork-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..897eb8c2c645ea18df5b04cf727c91215f07531c GIT binary patch literal 1492 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>V4dyh;uumf=j|L@pOjFEw*A80 zONF$oHs!44++4Q1*LZ4)gR}dR4e2X%=4R$d3O_bei`#PPh=H0|)LU0!-JP>DGL58P z>XdB|6f*x&!?(D=lIQ!mzn1CKKC9&4%YAqM`<z+y2U!0nB;!44zjXMMj zGI}z-I16|`U#V6(D|!6KjCE5Mfn2{N?_00o?I5O@!)jYyE}dyY0gA{%WImknr%M3;sNaq&t2H> zFZXT^uAf}heq+T`<_N+@v!q!Kt8J1>y)i6D(DgB^zz)iPXPr8(= z!ZS{}@UM&=xpbI&b4;y2ea>Z7( z+)JvczNsh z6HT@PjS>+QIC*tG`}@ge;-*W~4{fW>>V2{>HE8{c+Yc;OPcaAjq0NU?e7nQelbd?p z{c1VKa$E28i?tc^Qc@KbFJGist1aXFeQo*v-sEq=zd_deB{<|}^*>pdt+r=xY};RW z=$tE5b4c{y-0Jjc!Fr~<@7!*z=Zj;#QLydBriW1u%~nd49g+#%`vkx3cGaC^lJ4^U zU+^t%oRJZr{!J`*YdF)WhtI+#ycyCa>W+$vpX&Lt1?ClzV^U^mgS~ zh%YeMQTnRk$-?sn<}dyy*!Qn=KhpNubvmy;iw4hn|FsiswwyV7tKsd}ch`@ft5)e1 z2l~y9Gh*7s=!-TdPdT{xyE<=+e|kR-7$_CW4v8ILZ+MqT@BN)CV_c&z7Hh`ykxND8 z3fIZQzn`dXT-ZNXearM88Vej{C))gRn>WEEP8XiGM`n$<3(_`3cvpeb)NXt zivIUZ(^9{LnfPy7)U9`0yfE(3Rt8p1u$xl#!cOdaycfs?2Ir+URcoQ z5w=T>LqlA}rReK)2DOW(jt)B&7AW7W7u}TI)KG*dd~lXZBunrx-MS)o@{k@=)t2vP zCN(Te`5%2%SNLDE+fN0>g<&UD<{AEBvlTuwi$V5{;LIb=EGl1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SUFZ&-4lf>ys5SN)>S_}TP&z|w^SaVo|Rt$`j!$sSs3d$0ChZvU| z)&=pqG?HZBrhGV6&Rw#?zfwQt9-&r9Y~PqCw7YqwZvpIBGS;r{nJNJCv5zPf3F3-J zEW$-)X_aQ))BD`fXij8bb6CAw7BxlLm_iTjF0pe_?wH)>Br{|@W~GTebu2)NvCFw4 zkNHV_mRY=Gwq8~snS+X{h2A`2GZVdxL7Q{Zs|N3f!RAxHp~h1Hx#B#RxW$~NQRSmU z`ZVOaq7f@n6T&1Rd+s1cn-ey@n{iq>HP{~%34%0-;2se7bl65{*92>Hd?8yeK|V%i zik9}=6%{xVx#+~rWN6$(@k}UZBoqCZPmJRhy$dC|XN;K{_d{JE z`Cfyldr|f&1GKU^M2pA#0D*2y`-6j=JHJ~yA9+@Fq6_t(jzDiw$tUnmlTRVd(dKeU zMtQa{8*f-YtLDap;3-)+){G%Z90r>Dw8n#T?J7HoRs^Eh?#4pNE*ik>3349$9Thnv4cET^H9?*F z(>cn@rm7%gW2>rz1H^W*h5vTM(s=Asw~hy?*YP65i1FR?&H=c9P5 zT5b0uvuz^^n1ZV{)z{e&4C|~Ijk>kb74Haxn z^OdHtF<1;?_W%gD6~*e~;)Z3G4ZP1rNg)vbHRbEas~?iG*jQcYIfR_HA&7Sv9c4*a zi>Qq_fzW=1z~W zynrpjR!pgHqS7nfI8}C_X_l8`Kg1J?sd?=*0DkG2b0b4?PYX_L{&gyn8QN``ap+D) ovHepE>=io){B558x;T)?Me!i&U0OHr3!^~@2*usldEn>20ZxAKG5`Po literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-left.png b/assets/navigation/maneuver-left.png new file mode 100644 index 0000000000000000000000000000000000000000..c9f3aebfb5cafbec5f28f4cbe8a6220e2efe2eeb GIT binary patch literal 507 zcmVBm9uQ4M>C=fJ11YQ9M zUcPnfC&=$LKP0UI2*1XRI3R!P{LnN8Ah>**^aorvijuV@8H2MJrV;@ZKB>5dIBI&{!1cff8HkNm(Gr zW@t@GjCkAz zi=FdzIPU^W(E`<3X^(%QF#t;wY%4$928$c#>u}x$_KE5|s;ZHWv<6_Yk%rq~aqD~) z&dRYFs`A1yH+Uz!0{wgeY&r z7O>CWFq_HL1^N&RIEV#8hy@(P0wKf#4q|~2VgU!SKnSsbgIFMh|4<;su2Gd|RlSpr xj9p+UBCn{*m8xdakx>g+jwSAq<*842%NKn6(=kz8#>@Z!002ovPDHLkV1fwc*~$O_ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-left@2x.png b/assets/navigation/maneuver-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..88fc1d94c0d6ed4739615672dee1923aaec50c8f GIT binary patch literal 990 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U|#C!;uumf=k1(}p~8V8uIE=D z2xv@Zbz+^ww}shCA>=^-V?^VP#;^n{gAxb!V_XI24;@J0nCW@%iHdRg`qJxv_q?C? zSFW*tf=C1>W13ULOo0S7mKh{6%hVqH`}c27nAfb}>6%NWS?_Wy{BXJy{wl=(j9`I_ zyvbHfPLpfODR~%it-uYkj*>~L1?G8WI=GV%8x?fQ? zKSP%3p!ls1AXBbw{_U|^fTMnObbR|CphE3lkad!IK$ZC>yWg+jZTztL?yvtEQ~NDV z7i;AeS}&Jp(PjnOdS-iF`Rp9L(zWkBt|+s_zbMH6 zYn67z;_c1;qylSG{d$AFjDN)ih<})Ewy5pE$$cIxxOYtcGEIu9_*Lw! zW_kBg#`H<+R+?WCn4$QfCGTmV1FI0%N9pDz{8t2iw6wf0kv`9&<8Y)UY}NnuiCqnb zcik4nv2eDweUv(O^2hO8UX0uV7q4dTSW;Bz)4L*h)mzK`3JFfzC#=}2urT1+^#hlB z)3!Gj_hl?yQoKs@8vo-k#SIUDX8qNTZdw|BHjnxFo@H}`eJvkZ6#qJxDa&+P^wbBb zh#g#g0Fzk$7pVw~-*2quEWRSZ8nOWx$Lkwgt!M6SFrFf{s)4m-!zZBn z>zloKV;xu>MWX6>>mw>$-t#=0#>MC_aH1vbRb#)7O=!Ep`Vfu}f=p*x7>pGU_;45q zQTCoDHm+Dtr3Sa$@wqE^WZ3CCenT+=t2-!v8;Tb&}hM;J1wRjJ;aR3N${} RWdrjqgQu&X%Q~loCIG`zu4VuL literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-left@3x.png b/assets/navigation/maneuver-left@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..3a8e0aefa6ff3d90420f5cc95e965979fb9ce0b2 GIT binary patch literal 1512 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q4M;wBd$farfpxv7i(^Q|oVT~`7D}6ov^^}= z`mn6&glvSU#2bZ|4yz8l=9;$dfEVjRs{r;zS{&9LRve*?pNd@02Gl#hlS}Aax8+l5MTpms$6IwJBI0GGo7B#52FnV?{O%h;LQKX_oDEpTmKW=O&@j1O_ zrgr)NgIZGymU$hSeCAF5vomqOx;vu6RyG)iD$Z$JnjH1aHk;{JZ>Uy4sKb%TZ~lfq zXJsl9Tj?Mw?r6d5eSFKAxG%v+_qFa$=Umjn?>^J6S-vGDse1Nd^uy<%htNS zZTXciHN+ilPFC%++Wq2qlXYO4MfP(X%8amD zmbz)d{71j19TwTk@yK)9%d0nC?awKRY7_~!Tn0Hk#ogZZo9^G#{Xp5U2T<7)Wl&iW zSNogabPXf*nkpuV)|HlB?BDFc>I8Fi#tZc=`6tsqxC;1h5{#c4`{l7tP~$zA>_!#o z>&$1@MLeAv$0+E(NqMi;)W}&kX94lt|Az`KH;Y3Y|LNMS$Xl1~x5wVnPss-cj?a2O z`R{3F>Pxb(O@4l6HzWWi{(E=!jkV(44fEENGb_zYsVXgs6u7AR+Oy~x>!Y71FBwfb z-!*gR?^$1$?BVFBSQoL+aMJx*GkWvQ@*MT-reALYj%TKhlXUm*O@ovZl`vr zFF3zu^0PC$J60sloE^7#lHT3gMB#6V4(B;EXT~iKQv1*R^&U`z$NE4^m7&r-dc&5STTmQC2t0g_-%8<}o za6S8oWBA7R>2K_3GFk0=>#CD;9w>5s$9u2}jlR=2zDwB_T$ufTnbaH0nM|ure+v@( z_RaLy!*|82Pn4|(IZZSmF6PX$r88&WY_;9_Xu|U_$!{}#7*7UJv7n%$Q7m6tpUSH} zn$rLb>O~Dkii_N*9qdS-RBm|E_j*U&w6t$iB_Ex;JK1*v)2Wt*sA==h2;Ap<(N$U` z65!^tWy`8QB6o$_knTXh6YG;s0N01Q7#Mn+u4D|?0atFkBkctZ+of#-%V!~NqjFEu3m(Z0d zJSS=;*Ri8~KekoLkM!!568p>d)F)}IsN8WH6Iid;1L`{wRXw5_p-F)`H6cc-sxxVT zMg-XWNUs0-1&)x&>8Jz=u+hhqjmRHr1CI@;6*-XGu&xrApjs4)Uk!+7nnW&=_O@RC*D{>&ai8@M3yr>X(O(tX?QjIi9 zu>}5+55$EiqZC8n9(hL|5*MP3QVfA(@`Ct~YTzh^3cMk2NeDrs6e{qQJRl(ijZ&z< zC-R7d@C$(PRBfra(@{s(M97qfG%LCy55UY0ESv za6#F}YZX^y#_?x#Fii=ZP@l;z7MzpNK`8NpP1Xt+JZ};U5xGz5IODu2?M-6>2FDDj zh18Fek*MlIJZV(m29BLlGpWBCiF!)3B4BX*kjkW9;!ssD#gWzo49?jlajvST;z+9k z2IrlM$VXDep*miL)&&gCol_H1=3E`GLRSI<>QX93iFKUzD_+tdU7C;0Z6@3$R8ey?`gYcrU;jnRF;n`8%--tZ_jdlOpYW8#UN~ zN!V?m^X3iCAIbLb%42Qgjw}|}5>sN#T{dt02OcS%K(YtmFaQ7m07*qoM6N<$f^r2W ADgXcg literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-merge-left@2x.png b/assets/navigation/maneuver-merge-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0f4527d2e16de64a11ea9f0aa027517f26ce6f03 GIT binary patch literal 1345 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>VCC?1aSW-L^LFmWyxVRv?f?I4 zo)y`uA0R1dedNrwg)4T57kpybdYpk#YY~3{=Uiq(hwqmi}smiB!9{1S)eBe%cSy3KeQY3UJh|@xqqrfMh_0F9;FGF^tz@UHfhFI;Bzerr$I38^e8$$v4G!K_|u zx4Zw`E*B4trRraN5A0jK+;4rKlIq@uv-5+sFSW36YQDAgW7#lMK5+iz^BoWQ&CdLJ zd5^n){;9)YZ9S1)&vyt31fM?{TbF+Lo7aPn&%UP@N$j=gniA2@TkC79RQ|J__jlvH z#^dK!idwd{7zW>pj^X?}fg z{*7m}N%LFlA+6Fg_tL$GOBwdrO}z|Jy3JeKsTmXuM-BIJRJhI)nq5&SqPfw}x8W=>NSa!vl(l6uZtDj*bwWUwatwEcYmU5a z=^Qy%uQi(mAAEYTaV8T~uc@7OZslQ+z7L`IdLDV8VmSr5!b1 zeu~p?E1%q>HRrN9kuU1t=CG5CRmHL4LpVhB8x$IM1 z9xx$7*6YR62HhTG;fX$e)uuod?m|_%3EYpDUeR3N){`B7@mgS#tl64SMz&)$j;TtY zT4bCLeGR^))hw8haHm*Hcw+h!38iNN7p_T6VPH=7UlG$cIbfpk)*p2S7ChYz$&pLOiw9(lJkj~-ah4hLa#Synz8z2X7WBfgWi=GKzp1bIXRZa)cDeHbV{hBFrXl7Z>{TCT55Za=5NDlx-Z^Xz|h-D`dK zI*#ioOn>&@O(a|3g5DX$$}u;WY1zO2mHs<@fHBboZaB+n9=H zcz&LLNaFQ`cYS6X7!9}n^(g+FdFz^4J$JFjiu5On_l&m}?-HKUBgQhLcdr`1pyGlB z)`?e`c%(UJ-lmdK II;Vst0P-tQt^fc4 literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-merge-left@3x.png b/assets/navigation/maneuver-merge-left@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..4f09b30724ea0b4dfeab9ac12526e29e93401e4d GIT binary patch literal 2139 zcmeHJ`8V5H8;^)3Fl`0|H=RcJSMYh z`oy-W50<4?*GPeoQXD7+JCsqkUpJ^(d-~)kvcr!g_djA!lob>q2Uu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>#x}9(kATa zP66{Eg&HbW;z;0e_{B&at&Ta5M5QoodHSh zZ*}t;;|Qjc#TN0vY$TkS95<}VyxS?di{$kR+f?nt+4kGzc#c846YT0mB`=jL zGF|wTE@W7X4^q22MJG8VE)K8u0@F literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-ramp-left.png b/assets/navigation/maneuver-ramp-left.png new file mode 100644 index 0000000000000000000000000000000000000000..583176f7518e0dcfc34f452a4e6923920ca4e961 GIT binary patch literal 543 zcmV+)0^t3LP)eGfDaxLyX2l2!xJz(B#y`x8K!{Y zDX}+L0mDOL7lCa$nhzB)JS4VMwUJ0ZT)RgLJB8or{MIeMC&_fXjp$PO)1VShRJrscu5ICm(k}ij;T1h0S1;!$BM!Ib2(EpKj hnM?d9M!m`M#sd{=NkET?lnDR;002ovPDHLkV1kl#-rfKJ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-ramp-left@2x.png b/assets/navigation/maneuver-ramp-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..db7da0e0cbacda1e589f0868062981bd389a4bbc GIT binary patch literal 1042 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>V7}?;;uumf=j~j>JYh$Xw)?9W zY&pUxV9MIq$Mu{=O!lc?KT8L5f;@wxBfsw4{0U3ln3gZNFKwY4`oqm{iNNiTRpr<8 zXI9St@_K#Q*Jrhx+yX`1j~X6jm3Yk5Q^$!erPpYD#G}FrK!M&iAE5!Ug|a+ zmJN(Q*`cEs)O|ve-DdIG#A9n%&#dIU>7uNyXt-6v6U4uw^r>mf(uq?i%!uMsXqDV7 zX0Uu)Ez_+_C%im-bUT+CBwu4%ru3~FdZWa9$e0Dn8p~cy(Xhyfi3%S$%2GN2{ z&#tuacwVrbE}ytfiNz=NMz=*q`&0KBYdIK`CEqFW-75Skn5OM?pd)J16_&R^^EN-# zS2*M-?O89#Uds6P!Ghu}ry$`i?JUo<+<=bQ-O*e&AyYtx?B=N2XfbbPiUa4K{W6S#e0NTq6)(Jy&HZ?$7u%!*ySs%AmaC-* zJ8susHHlH>!@Wm9|9p0pDLLGF1654>3iSKdqdCpbwLLW&zfV8g4e~rf{+^J-oI8R85#b%Ljz$8{%)jckU=Ga->S9aE&zsUDQtV7J3{32n0!3_(1PeeI9aXMrk z`Cnzuq*FydC%$2gY3kUxX5W5|O$i^j-eLO3ctNbR-rQpPIbdFA@O1TaS?83{1OS0v By6XS{ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-ramp-left@3x.png b/assets/navigation/maneuver-ramp-left@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..41fe879826cd28a893e6a04c9aacf760ed313eca GIT binary patch literal 1737 zcmcIlX;hMF6edCgOpPz8Ne&JopPHdmQcfj`ip7$OOA~6PnQN)1MI)m!T*2xDXe2e^ zCzi{ZN?XirS~N3F9Z8)G%<7bxHOgdJWLC~+%b$MCzxnYl_qoq~?mhQ?&-+UG{%g#! z)>s4rVa{Q*g5Xs)JmtrrxY{fSpueD@)T4)pJ9#6{062}3O-6h)P8Rt-#)dl>Jn z>6*OJesbMkE8c2%sVww<5(L1`k}=6yD8QB?L)(g3Xbi=hO~QF2rE`98VR!A^`P%;N zych3#2BtKYrkD_Pb6WNX$sc~|=a>nc{Bud%QIr!3xqt1c<8im=qCSY#44@p*+Ve^G zA!|d6kWHWTjDrF6xJ&A77YAD{ZTzg9X~Kkz6~@+>kB6C_cQ36*;+fwwn?zRNt4Zm# zlNX4KJDkKj8<$3u*yQJp#J4Fat41FQhAt4%9n@+3XMU0V_ph*yd#eL*oKJOC>5?v5 zI_nhCWel^5!cgS1j2Qd=2SI>ar;g0jp|ke@7g**&yFmh4Unm<5LeRri%)vWo6Ke6__;0TYb8&{isfy_s%#^39!55MKm=NT=2DkxSx;pSXn|Jb_SN&MW>y*W1C?}J4xU>Z)Tg+N} z8V>{IR#Z3L`&lnq%-X)0!lb7*rwKI2fLX3wD5&ZIzS?%nE6a(4^J~r=`WhfifEnRI zA}?uSAo5t2NlkCYVPD~t-i*_{4=ATlf0-6k_HJU5hw_===EiLVBk5`hSRJR7Oi=h7 z!K*yIY@t@6cjbQN@0r%?>VbhT0(5HKnR(GpDP6%LQ)!_e@>mY&K$s%!S1WsM3M4uT zKSA(XU%Er)5y0DO$!<;r%IVZJ-=tQn1kR|4`^`>Bv*;e^n_H=PaQXB*1|@1ahK{1v z!@3dH@WqJgtCJ{u9|n_$6ilBRn*7mpS@Oq`@YM6cfo=9=T$i0V=b&$8(sj70aj!=n zhvAPUB7rd~5RVp&!^L~h5BRHz8!9!5BUD_M?KGKo?h)K#vq4?svPDih2{1Mrh<6n1 z=52f)<8~n1eN}C&FWB%fb+TKbr^zLgJg7KQ*LL26?RLN~ZTI$pJnr%g)`M`Qxk>w` z{%7!Ui0)j<+_paCq8NN~ZCdFaoc8$L_iDJB4{$Y1X>A$G8ms(dotj9y_P8Yz#%=J& zMsA4)A+Xxh0cXr-`ZP5ydReTx>Z6u7P>r}#M=psd1SZ)4iY;)P5`Do%RGd-H%*E1b zGzxryBqhSYg?wTVQiI&BHHHnX2o`9rx48{2tV3hyLM(5bHgUoor1>C;NINb?Y>_Re zD44m;Xn+IxY>AXow6;qj7BI|Tz}EZ&YG=3}WEGLMHRES@kX@iE)_^C$lcjNHgj2M5 zD`h!Y-6bGnQp~Zu%f3+fI91N44V z2^?jl6Zc}_{X$aUC@>r=57p>FZKquctC|O$!~o~Y&87SXRK1F%CAx~%l6zgm$@V|I zf&cM5{;w`{NZ@q^x@Jy1uM3MQz))5ezcWpXop6br&<3N@6{-RI$?by%VPXy&T1(P0 zUh*zl8gauj7^^7!)iTG>seod;q8DWWxu`p6q;qE?Z{FZacRM_i*uPfJRISJ#F5dWw zlfp9m8LGB$&>$o!N5kZA$VB-X$(w^}hCgewtU@z8;YzR9n5U%7y0bm3vl-R+wI literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-left.png b/assets/navigation/maneuver-roundabout-left.png new file mode 100644 index 0000000000000000000000000000000000000000..dcf6cd7b15d7509532771b54ec68035c2f980093 GIT binary patch literal 774 zcmV+h1Nr=kP) zp&4Nc-$`PK9oxBf5`{|llRo`c65o6N*s@iwIljQQ@ddVxFR*QVfoQ`bTD6S2L4u~h%77;t1XDA}4A`+?UP}W500u0$9LJ`?xkUlwK?sFG!uEMdZwxuG9nJ~N!7D_%x_yTK~<^uaOjR4y+dn#pcn-U|kG>QorJRrJg zS;PPXOmnO`|0rwsWLi2+q}+~DfkXi|=n$c}@e6O@JQu2ZUkYH4p@`hWd4`-L ze9r)%$U@lTjIcj!o^#Gkf96D@fWZc~P*0X$jR-&BGmQDjAeZCVz9VJO8{BT}9?{I13E4jRAlGoN3Qf8jT_&OX*Ki@H|0eT>`!1{()NPqME@q|*ZS zE_jZ1E5&@D`4iuveV<39tRodEED*zxp)6jFNM{@K{T*T#=Svtj@eSr-SF1%<#;Jh8 zkO9$?e^(>YSpkFZ?Mghw9gMN#mzc#lHdtdsR>rwN41UAh!P@+%lV$3TV*mgE literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-left@2x.png b/assets/navigation/maneuver-roundabout-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d5128d5689410cb3164615a2aaf29f71dddd0a6b GIT binary patch literal 1578 zcmb_d`#%#36yIjEOhlB~(SEg0`Y(H8Sl zEKHM>5l(w?m8wjbEI#^@1klWmH`j7_6Xt#+YbEUu$#RlYocJn@{y{K|@8tA{O>Z2rhq`N# z&IEs3sJsOP=bnqJh(5|dLJ->n7kuQKd$aFG%x2)%+GHE_<1HXiFHelRuCiZw?LlwiV8@lX z55l4;zEt@=Ej>I z(R)NG?#U~^NBGyM3)5D8>8t}C#GvQAoY>x<D17pYc-^;}LYji(f57j@ zM+RgZRJYis+3hd1UJrZ8iyS>ZZ&Xw&(4K~{CBCH7!tGuApOqo^ zC9d@tF-r-za4L2p2}SNXk>0(=rk{^StL}9M*a@^lLtqE!#o`9U^A0>URk-m8@E~`` zVM>RvJk&Dw*=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}{3$8FH7`n7=v$a#KEZ!@YOz746MT_ey^FBZ{v+=qF z3QCfOJy2Fg%%5!Z-AWp~=X!VKL6QDicH0hAmUS9OFex#mWGqUd(d|~gxHyy&L z91;n5T(+qZPJu{ubaXm9hVj5wb>WFB%dqc#K*kOk7Y6#OVnoy)KdLSY-2c;fL)Sl# zQJi5HlH%mj+|Z}3&0V=_N*uLA{s{>E1ccT>2{f@(YucD$WU2A^wYCbfSan0<4967F zTG7}xf~Vac{Dv-^a?L$C6x!cHr$b0D!xjeuH-~k|Q-L3&R2ntd$5_r?vTpal3g$GW zJBO_%Im0FrF#df{cAD9`H>`0uh)6lQRak#Ah6j!K(B%1W?qFDv;A*)DWEu>iPc#uL z$EDyM_Rd{xX@&gBMO%(1f-yQ8=AcNR3C>Pn8)sZ|YlkBHBM{h`L+xnNS|-)?+o>fa z%3VELcal_&AD1K0to9!WbN~AhVb624wCMF(=S6+M4PWUF_blMXS`x<33Yc(PbZSu6 zbv)#G6HAe>-Cbg+)XWqC-S+_9Ma~@?gK6PM(3IptgMwA5-)q~xd*4o=_XYJ5Ll#+W z67%W#m&XPvMjT_WAPfXX`%`c^Qs zdi&IrQ-guy3aeCJQ1DVk0JcPxDCpXyoV~tcunkV+{nb{te4Gk=*g!ZJFKjLPRPw)T CuZ(#B literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-right.png b/assets/navigation/maneuver-roundabout-right.png new file mode 100644 index 0000000000000000000000000000000000000000..e04f583f33ccf9b5c6868e091b9eed0beb83a4b4 GIT binary patch literal 714 zcmV;*0yX`KP)D0?vMv$?J2g;V@szvkX@DVzr$exbE#(>xRWNs8ofgzTN`*<7E*vBsnIwntG zZ6G3BXzXHFRV_0qr2qriPPg#}=HWjM7}8G0)(3K4z>(`T6br%4ZRa;IJpA6&KWN;- zyHg!j;sZmDd5=Km3mA3^T}?TSG78wvyT|4TZD;46bAxN^gk66PjeV{i@cTgG3pf%_ zLvdlau?_SX9Ur+-?C_4bHTVqE3K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0V=IhIAxwH;gpgN5111u!`oL<>0v?131jmR5uG1`<(Mn(e?0=~q zt1fOKuIo_k!X>l*T9q2F=lK>XG+J;?L1>k{DR#VS4pHu?pQ|JxnZL=^FS)oX+IKP6 zTk^&3v+u-22GJg5U?A_9e|^htyj0|Kt5aR1A_rg7AUrxJNDzm8RTN!~NsBxqG(M_m N01o5nR(FB?;9vOCmN@_b literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-right@3x.png b/assets/navigation/maneuver-roundabout-right@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..c3730d9c387beef562373f273e7eb8e3b01b3631 GIT binary patch literal 2461 zcmds3`8ONd7S`05NKsQzm5>CXT59YqFCs|Hb8gxwH5BE(Hi#H58a1|QWuR3c5Y21swlUq?}18W-K>I%H&&qVQPfpw!CGRnLm``ZfD!gS^Uf$>cn;8w49FD+#B@ zVQfR1adAVg;bo=)vM0ioOaWX`yO&y_0@nl3o8NMmJWecK%7(IJx|C!Kdz%8->}C=o zo3m!(w|$jA@VHB&Jge~MoKnsu>V^02eEw;Xb}w1E1AS9TTWI+K;D97S`*T5(vdgq1 z>K2U19=SxX|5;M;oZ#0^mubW->`dvQ(OCkA8CiE4v2X0_qPVmB@Q>6T!^DbJW`RU& zyId&W{tz(AH7lVOPJCeor#c^HyXf*>D}P)r5*{2wT&IgnaxY_NAdh^Yx|{0aE6KR3 zr9+fz`D~X^ojxi%v4Yeagw0a7jkN(YrHHF$yElxkwdKTvhFb#}LwG(5YTA>x4zNfh6zM|XaYe~!E%J&)Q6g)Ax zAh2i%Kd=RC@~v@*v;u-x-Dq%?>jK|V{k!I#21YHvLzqp*?m)p*yu zny+|6KzU)WzcMS_#ZoyzWgbN{Cc(7#^_$TSi|3e=2O{+YonTFM9}V(6Q|g1{bfp>% zOy%|y!mw-X@jGHfmp@eG94YRe>CWO473giAY3Ov8ic}2H-@P8_j+ykgF3M(=>dDtP+voz#|Dujqt4N!#vAA!DmTco={`tQ)-G&3oMs zi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bpz87#p8{i9zkxSl7c#1vl6E#0_ti7Hbdy)Xr@%4MLtip9N(p9T z`40-riL(4Hfe{{I9;3HWfZbzpFW^IlyZ8$e2{FVF&haIF!8}H9slZtLZ{R7W z3+;l;$Kt+%MtNLnps2tx(Zf7z%ZdZ$V`;d+SS|{r3(K6C`B<7PP?ffT2W^4tXbX67 z(*+{p4D%Sh3k58cI3%9pg3ABIEOX-pER;xy9h?Z?k5V8bYvB(j&?`XRA5X3T0000< KMNUMnLSTYfPGTtl literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-sharp-left@2x.png b/assets/navigation/maneuver-roundabout-sharp-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fa542f92c28c736eaf85e789f19b804cd8d79077 GIT binary patch literal 1530 zcmb7E`BTyf6bDu;L^Cx}OU3X^zY6Gjl&)rCisI2hqJ|amQ7a@+EevtMY6`ni~iNmEv*UCmDhjf%yEsc*Dn43Dn`Ne$MZlT}h`aNTFya zpAvDks93%-c*LzKSW`>;+0xgyLzCowTyY;A!Rjvg-uif5V5l<}|i;?f@ z&Non;E|> zo0`kcTFwT^!Gcl`uZJ#Z|+5DdLEe-X& zOg6cWK+KS|ZbGGS3LdtmLH?M``UIQ_5E;%|E>N0p1+)i+FJwc@E9w1##GJ zZ*c|kz)ez^a{6-S@Ysf2MYTX_kFd?j>kum(w*YL-<1H#$2uk$B6QWdhlV*zFY_tTN z!j9X$CoxAa2o@$GIt0FXYjPkp_WoV{>Ag1C6n5na$DQ1EsXR6QufSm@ZxFw6(1{Aq z=u~#MVpc4=ejny%26L?-SH}5a#V9LOL^eI#HB?n%_1ke!Pe>ljMV6=p zZ%gl_bEhfc$wU**{)_q}Wi+(JtM&@)GT#bwh~du{)?3<~VnG&glgdZ6BGl8Ee#9DV>an(iQa1z6$TBKC zXddY^4*-GiSgoTp{wnlL^03L_Npx;w9b6lID*b} znplDy)m?z}a*adc``{INh+YYSfkcLkuv?}YAg>;{Z^2lU{1*+t^9FYo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#V5>Bo4LUtb=&e`I as(*jmiq^#1_3{)I&V literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-slight-left.png b/assets/navigation/maneuver-roundabout-slight-left.png new file mode 100644 index 0000000000000000000000000000000000000000..9674fdb60719884e05635905f1c6922c01579495 GIT binary patch literal 769 zcmV+c1OEJpP)D0?QWw2w;$+jBx|fc2IyN_$bTV-@F^2!35Jwa3;^LyCae~dQ@E3?f6GxJc z#sGy-t z@}EI55enGQ2N=hWPu*lG#Y8C3Br51ach&MS7AW%L;@da*93- zagPF4BsZ272#7weiVYt!e3#6X)B*-2dLpumu8fD5$w%k_Erl{2B6Ac|p+J+UpbJ0n zE8fEZXBl7<8=B$1a4Aq1|Bal)2{tr?{ozs|6#tE!h7DiVHTQ{2fq>{^9t`lVuJI(6 z7BDE$lhrozD%g+SA?bx{fhJMGS%&xu8yLsVonTugRPl+3+`vVYRkbZ1C@zHpb(!DD zHee_s-|;0r!iWx58E8OG;co=Qd-?N?Fj`z+C09mqDcn4i%Z)r9o*Q;Ke#GnhcoT2o z2adNT0j>{-F7DzStaF+rj?F$i2Fx9k+M>4jLaheom&sni}yM=U}bVEODF{ zapOJVTZ8)y$T1vyMqEMT4d;H6sjw!L%cnU@SyP@~63zt{!7y82z~>`Wm-#P*F|75P z#cNRn!$h0dIAexSWFlN25T9{R<{7fq&aI51Hw?5xJj95^r@*x~;3<|cPK$L_a%I*k zU@(~7cpr^lXv3V7Q@G}ss9}JMD67Zk-^ilCRpK#T$B45Fzu{Z7^GS46H55)rfk{k%6iF{KDPT~-p2P#(#|V4<6c@4f@J40@A}F#$L>}RDjMKsz!}nxO zGA}R-WkQ*J^Ta8u=cbKQ6iA~e;6PCzjiP`9MS(Pm0uB@f(kKczkavNA=wqC+ZbJcs z5>29l5nmX-L}o(n1q@2mh$^;)fBI5jKxV>kbZs&~m7y%!00000NkvXXu0mjffyPvs literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-slight-left@2x.png b/assets/navigation/maneuver-roundabout-slight-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7562fae0b2c6a92e35e8c8780b5423ad36a9df3b GIT binary patch literal 1503 zcmb_c`!^E`9N%U$F$7or0*Do>tY$2ADlO&o~?Y5R-1n0?G?Wvycv<)isYXQ?{Z zcnw4-#>SsOM#TXtZTSf_7}*?U;P!x`k_55U%F;!OucScA8Di11#c4xnM9Adqddyt@ zx?L}={p07hl}mZ+!K4Tl=oT3G^uJ-gmxD93uCNVY5Z7)R-maX%yJwn1KrP4x&0J@* zT#Xz=AlwODiVRDUp|jkCt|H44ArJl<<3vX97+-LsV37!IF;~c?OB0%_9%Ldx$VyTd zLQ&c6<-+#jDQzQkflN8xENFN&)(nyL#M-}b7Fk3XxLyK!2N-&MIlJ;g*~HFW8r?zG z)^)Nocgr%KS^K#zk2)LBq zM%HXW*4I{=(j8RQ&LRBBto)h)?yz!r;5-_U6=pqNk|*q>qP|X3MqPjOX?a0^UBd+U zg8bQX=T=oOFW|N|Fp-(omy)gTI*w z_f?vyIjJ;Yo%vsyTW-Uc?sLR78PQTdAn^pUJB+P9T(!DW!^18;k+>S1c;27wHe`}? zFcNPM8Az^x-*eVRd&FX}dR&kpj6=>RmE44Ojny&=GnS=?-KEBp_r?m;2HqDRl4-FM za*m(E=LopK+t1>b(1-Nf_#fZ% z8y(V&NV6jQTwpgS!(@M)$akMGd)`zh|Avn>fk5NcQbW>>{=MQ9N#di<3LC#*uURA6&ng A4gdfE literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-slight-left@3x.png b/assets/navigation/maneuver-roundabout-slight-left@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..14d5a3c7ffb2d442813de6ff847b82857da3f851 GIT binary patch literal 2439 zcmd^B`#%%>7iYO`atWDBSlf(AM5tjIHnzFn>Z_2;6vg9l%RTqphRx&>&TW+B!+2dNNxg}3}*7y4te1HD_@HwB)=XK8O{XXZs&g-0$z!O`H2&V2q#h>g?Idb}aUs$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VAmxTG_uc=#@aNkH*S(d`j1n-v9*AUJ} zrpgs6yM3Gm1yE1{R1i10JS+1m(`(=4Ih0(kR=e<2Y!F82B(JBqi>|tD+k8-YkB_)# zso{#gHK=3JA4_btUN+m)hDnEvnkJW+(x){PhDA3V{lkh%c!Bp^cC_CeYj&*aEuqat zSIT{oE${|3J*CqHP+gIf(P{5&R1)zM;WX^#Q{nUBaKcpMg>k*FU&({t$OWK{U^{i@ zy4>lX+FTIhUhtUy#NIbEReqQ$XrRs^&apf)6P^a+cK3EV{h$w6uZ8LIzr|1PW_%gQPlJf3Dz-_ov9=*2C*zT^ z9fho#Y=zM?gmhDHAPYzXP5?E{TrxhM6*&`#?Tozjx64f_QZ*e&EsqCg3Dsqc=CnpJ}|uATx+P! zO0I_*;@bj7$y6*|t&L$eWmgvaaM;7j8_sio^OFyL*Q4$v4bh4*Al3botKtl)Im8n! zgSc$-y{ICR7G<;+yH4GMD+>HM(G$>K3W1!MNCVOpNekrad=bJ_rO|Q6miFXU@$QyQ@1$Xkph)nWSu(s*K?Z ziV)at(|Y*FP7{HJc};DoZ|M;!7510X{36Nkqiq=v#fR6FV6Jm~ytEONszxw47s%6E zd!FeJ*yaAesECq)iqlIVu97YJ7^b??DEU~lXMteaUCsj<9T1tR_n`zTw~73ue1?`_ z)F~_lsu{_}F=yZ5UJi*2KPrP9_L8NP?l1LROExCDZeIV#}Tuoc#d!hCNd3+ zK7>-Bs*)68H+S2XbP*!}$SV_L`l8Ha5~hARt^sPzLk6awNCjY6l@RIC@l6}P#rK_} VuJ0bR7J>y!h=6m%-nH^g`v;>cYP$dc literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-slight-right.png b/assets/navigation/maneuver-roundabout-slight-right.png new file mode 100644 index 0000000000000000000000000000000000000000..d6b851ac60549902282403331032bcf31202d23d GIT binary patch literal 747 zcmV#IQR5q*_ttiza?Gg;ESsvpvZ)IAW-^&<5X~uf zRdt(8L~&^(3~R<2Q6TB>zgbv;g2N^;P}MC-VeSPOydfeVu!b)5D9|SpSww*vF&2>( zbRkgHP*RwC0fQ1vA{2)b44*k;=9@loEHPq!TbIhh3K$M02AXjL8{P{rWSub2<0=|o z@H6h?Ha^B8^eE6LQ&IE+gP$a>;zdm365ha~1e$RJ8(s=9yzO)w&tMv7@c|Zw;dAH9 zJs=N;x1GO<)5Gum@hckV@FCvDqKufoNoL}sfbD#A*&O1K6Wg_Z1diJjk@uLy4?K<2 z3^eBkHcAy>s5)^SBVKXR|Avp?_)tVPFwR@Nf-4x&h|6f~al&_GDjeSs zk&l?fI)?JEM4&l0uu-;vJyGm&X=Ltx1Z!+p?_-<`Si?|&&$8FKC_2M1cZm~dJm;i8 z$xK-DNJMrpPN3{K@7v%tUXP^!%P7z#o?@IpDIhaawt&ke^io7_;SpHtG>g-s2!?49 zK5pVqs@f0-6rEw9!jDmoZHUNgY+{^etm~39Q>uW$U>#x&jYAwV%s%-Sj@co)Si>aN zS+h&djE@3&KP6tEy`RRA;X9-gr3)C8SS8vxUBWnpPcV(|*r31x>4cX81|{r2aShin z!d~COBu3a___370TY(6Q)QQLz-orRU++uj=osaNdU>eG7O7btzKpnoclBfz~Q57ga zRUnJ1Kmn=(SyTlIP!-6cDo}uV7pM{6FixPyp@2b&H$)pFMhxF1y)gFz1|_;g2SX9* dQ{aH~!Y{-Z7eGh;&x!y5002ovPDHLkV1ko^M9}~M literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-slight-right@2x.png b/assets/navigation/maneuver-roundabout-slight-right@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..151830187cdae5d14f0fdeb2899beadf3e894b13 GIT binary patch literal 1511 zcmb_c`7;{`7)?Ur2q9P!;@k*|#-J#cgisMTL5eojpry9brs}M?T2yvitJGCT8&Nc? z?k)+su5OJ+sIIGur9`V1LutGE7wj)P^WOLU^5%OpZ{B>_ULI#;rB$T?0Dvsfh2V3% zsoyCHIiBxIZdw5V;ASEL?-y6TSwSmQ*Jq+`(FB2=t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cDT0LGUhRl0*a~tc0LxYpr-ZNw%w6}o#k$pMr!a{5r+M+ zxabURSfQI#a%W}fVzkgi62h7>FA*tBT4xG2*P2w#W#4%XE_;2KIM)#|Z%4k)dwH@D zB@^Ap&b0o}G?MJ^($vn|^Ts)=PrfX*SwAYp=Dp$pRvSLVZgW4KRfQ`NnTnd6)BDd- z!jnF_47{|gN?D@uI!`u%hZ+n=are&&1hwZ zh#I4RutaDSyRf$pq54B*d9M)F0nf5?t2n&et};J{^5r;ASvM$#V7b^5lzeJ{TJ9d3 zpSN~9^eyJ1)BNPSNL6JIjwfEc1q_*}iex41TmY2Sokn;wE|E%=jJ8xn4+Aq{stLEA zJoa(moDMu|&&kTE$JtCgR7RJ5k7pD?JWFt@&npd~giHE{H-X+d8yY%_b9CH2Hy}T`SoitsZTSSh>g7 z)sa{VE-lxtbsw2TQbWbp3A`^(AOEP$V4RLww`kGg2mY}{sU2=xPA|ZZgjw}0ZWG;1 zLlb*@9%-x0qsgoTXffIwnirZXU$pKrxNrcGwal!Gba6Bm=xeqA+e!C!VS>kCcmp|G zz`|Tj`qKTda}5q-(^N9TqtH{(d}rz>6HM>`s{@l2wQ|w@0v81=8l9R;Hk7mQ5r?yh z7}L2+S5aBraHl9`OVr5GVDDS9wx(ZY6zmbMfj%Ou)iIvDj@#@C&Gf@-+StholRsGVr z66AN*S5@Qgq>-?6O+L=>wNFzniKg$WPny(#W_z~bfNK8bQbAgnBD1U9({qQ&F;E$Lek_J zYurG4jvR>QU2dm(-}Urc=t{(Mf;xaI!yKy};+ljEZ~R&Ag^*TqH3>nSo7Us-G=y_) zDbZbBTKm-`HPRn~5oaY(xHtU@ae}{}rGy8GWy*hEv3C9ochY%N<%^qlA9`BdQ`%w4 N5DD)1M*F}k{{f4&S(N|) literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-roundabout-straight.png b/assets/navigation/maneuver-roundabout-straight.png new file mode 100644 index 0000000000000000000000000000000000000000..ad27081f38d553ff3476639f655b560d3d135566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ver-roundabout-uturn.png b/assets/navigation/maneuver-roundabout-uturn.png new file mode 100644 index 0000000000000000000000000000000000000000..daa8d0f16b59dcad6523860d4fac07baf26e4001 GIT binary patch literal 757 zcmVVu46h+@HshAZIr=%iTL1x%M!U7PXq=D(EP;9aQCoK|EvI4>i7*~{;baZhjXmM6x z&c`vazsHW}k1gA1j&yV*JSSw&BzTR!v=C)zk%6OeU0@ddet(Z} zTuJJY3umDPSh!(kM|gk{j*??$X6KUJ*9&1`1z5gKq&N>vO0>wz2rI$j5%CRounajS zs`zMCDo|nhAsGb{G8kbn6lmJunXf`iQquwnF2M2;ag8p0Ztw(ibi`(MXl7ej#4aU< zXG$XCc8E*#NhD=917>3z++04p%;sb%LJP!JyhNhF z0?Y;N5;Wvskv`$`TGE-#fU%Tl;~2~Z?GiNPV3C}7hNE2n=DWoJjQ8s zB*j*Nss(283%}wUEaD1d3iQZemRaBi+{f5^X?%4!T#YjXsIi zxIhQp9iMSNwl%v(Q=;fM>geF##qAEx$F^n#Vw+s3gJX*inR4EdsNj4E!nyGl>R{pG zL%j2&B$_c-24N{!$~{KzW01@qfU~i!TY)nC4+SFPH~J*ngaQsqToC&>RBlVkUsw=&mlkElofNBE>2f}me7VDfUjEKmh-W#~4(rLJChd1C_^U!BR9Xo}* z03lEN`{QkDZ4OO`1u`5}LL3Kx?DtmBD1Pc|B&|`?aSEn#tT) z4CVJ7Jt4VwW39-81T?fH$Uvvo&eS=|C$W<;kO*WCs+eB{5iI{V@m8iriH+6f?dP(_ zZHS4@ZK>|2l?buSbKc94jhl?@d1{E;i;b$(7q8HDH_DkwuGQwwQel2qJK z=@7*dTCQL4Cjn;QyhAT)wnEvBZLuQ(S5aVOzMZ)h*Ka+5Xkr>~17;Nh`WwQszOaH^ zfM6-eaXXTbhjQYiB!bDxqy&q05|$N0u@I@6V_pT;ie5SteH^TByc;i7I|l^pmE#>SO^p3~(V{(RNQEtOQSbC}s?pvOY0Tp@eP3#7&x)7|=~f+#$r0~_CxvapC>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ation/maneuver-roundabout-uturn@3x.png b/assets/navigation/maneuver-roundabout-uturn@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..daa1555537175a240d8620530e9b48bd36e50f73 GIT binary patch literal 2460 zcmcguX;>0i7d8|XF+)Mr2`4ZRaLIB@OAVD0aS1U6$!*j$EoV}j8dNfM2j!OqW$AA28|>fcDOkvQxE*F7uvLpOiCS;A)2I7mPB* z4MweMy8Q#^TI``hXh?P0&$vYMjx@5Fu-FvY50r;Akddu36g7=9?hFw-_*fz{zM)|H zrK1zBDd_uCPd?FO>xmM2#E3&+v{j@8Fcs#oTe3N+zrj=Tr?^N)%-dy2rP_2jlopFb zO@z{Qa#EhLF4HRP#E)`ztnK2CpiTfwa%pR6zBI~Zj*gndg=&Ah3iPRP&XLhGA3p@-05&`cIFmv3Ei{ft1-JdSE zwxB6oecQ~|&Q$D{$V^R#carmE&!|vVL?2CXROkKMxp!uAT`_E(citqCO+8Y{RfKtG zZSKPRKB$AIMpU5L92v7HDk+BfxbL}GSxh%eLX|IKK>K(dMXg?L(F^v)u1>Ct!^Yo> zMA+7c#1L!zNs-nvX$AuJPF}hkaD`R3X}Wjj9o{J;50Wcg#J$e_dE>xvd2jOcanHI` zVr_8JW3ffw$<#ob@U4QS9cR6pX=0PshukVYCXH-}%U#o0rhhyd@7>I*%R0MWK2bXc zbF*agO*_P+E{kK*Of)=u7Es1!55~A@#+qhCSi9Td;9Cwd2|X8oTNsS^4lWmoJt5OXD4G8q(+J1EC~FuNH({UgB@8(K2+ZT`ry zGF`TX{x$g61$tZ{|Kd0L?#FPiNwmXv%iF(o%21c5#f{7HQe(3+-dJ|QXbzw%8&MJI7lL`uo&l<}-xe-*TyzD^cYtTjmsH5^<1F&zhf<>a zF#A<==^0XvEWQHBS|+AK4yw<4CDyWA^Djo|n|J12{sSlUs<}oHLCrd2uYw{AY8+eE z&(yEE%1y-xm^L(S1xvQ|6UGBpFBwjWW$|6k{EFkz8SY*C2T%dq1|NE`EXs5nEOpy` z(Ds-p!60Jp$=M%Vfv&_)GG4PMpInh0BZ#o z5iZd+vc)xRg$tX7Br(+e2f)?b3c0yCw3reigq~21!=1Ac`Nsnx7 z(uF-0?(IOSbX4w5J+$leMoT+k0y){7Y+wKwipdHe>Z&EVeNf@KtLIlabYOa(TUwHJ z3cE0THsQn%7AzohI7IpS!CZV@{v``u+qMdZ0hZ!+?bbn) zPjUay9>7uJ0+S|S#q;|ALMTeqe6t(M?+up68i$417^r*Usj$~*wKHbZ_T6w^8oLX_ zYilA*iP|P172YZmL+2mYOKqrr&cKd0*h{Q&tq~i8tZ)gSGd^YMIl!3Y%xk%VpK?t! zUMlGE_?~kZod}|Bj9?6rK{q{ zqMk{6qv?xUFFXSKp|$@2RQ>J_C(s`mHrCX|);WBcJnmK_tYuVq$msk#x(8~v`ZiG+ ze$KpD`nma!*|Qn;G52Cs>!$I!;0EDgc>7JOk$eKw==>qu{gQIzmcBjpVThJ0Ss2?A zy|tII0CESWu$|R$O+)jQd|A8~AnnE!yD#`_-fj78TU_ON!Tr^w5yMf?Bp?}my=~h~ zU|ZK|trwxZ|Ar3G)O@uJBhQ^*OCxvDb}n~AZTL>jSB2TO2yF$9l0td0(em-n*|Tcz zU_bA^z5fOos*jL>K!21KW=pSp-6CVWkR3pZ{#HKEwOtzrFNcs1bta|g-|()STDV&M z1L^J*rMu)mw&93Vb377F@j0t7)l!G!!D%FHOng6iqmeN7KLr{x%?SB*AV%!6O9K!R zld)%JJ>WOlFL0BCn!1DP=lWOsLHH-unXyK~enKhZm#2{`#CBN@!69+mmOeNHcS5g6 zF|ij^jOxuDO$wJ}oFv-eYdcvN4o+l&-`{H_eAMDvO+3y!{CWR-?_`y_-@+w2CyC}{ zh>*PS*PFBLJA;h`<%K?{!EqW=D^G;%LhvTcXH6_W`d$N+`cnPt((v6KNUZUS=KKvQ Ct!*6u literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-sharp-left.png b/assets/navigation/maneuver-sharp-left.png new file mode 100644 index 0000000000000000000000000000000000000000..128ac1115ab478d6f055c1e6810f0169a7c216b0 GIT binary patch literal 585 zcmV-P0=E5$P)LJ9Vo1$014fCX$=03DbLc<#U*WTt{K6@>GpjPN9}=iAbJ zdqzIe)m!A}{d*QpBE|H=Sq0{16_}e>(x5qQTOMN)x*@`2jSGL0mez!T*IwJlX3qI{sXB??5A57f3a zff3~cwJk|tWcfgCOA&}D|ChWWU20o`Kt%bH6q4SOF109u_{JQBovwre6=O$YXh?2+Ix%};rz@er zfw5IQ4asdlf}O4u0$j9V+>^01B)1+3_PP=YWE%GXcWFp&S0vc$N+hsX`~!SW_{n@j zsau`FURNT4im@Xx+>z!K7n4FQ^8)s|5(yj_TU~NTnp0d%E^nDpu-BDHpkmyR<`fr` zi(2Mn*y~Cm@La3{9ae!Uyas`aasKiA%ghRmWG;bBm*4QYy@dY<9ym#SB!SOU$_M@d XIHxZ_qe19#00000NkvXXu0mjf#{dE4 literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-sharp-left@2x.png b/assets/navigation/maneuver-sharp-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2f038ea83cba863e099e3496e5826a8f71c619d4 GIT binary patch literal 1127 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>VA1n*aSW-L^LEa|-rH^ht@le7 z2;DgN(&|Cz0qAW_3UU~(QF_(BfN0|*AhOx`~*q6-zqbgOq0pBlsBlb z=UJC_zulPerbT0N7q`JNR*A<`O<{H=kR#hqI4k@wl zX#CgqSGttM)+KJRsOBj%tBtYx@(f1h)8UgkT+TRbWXjWs_k6^3tT_3nmyozYAJ0>5 z&zJ)RMpM_T6fzz@5wUO55!Ns2#URNG{hX)5C+%pMZyX5X7R==Y8nUC|v`-93(VXiA)69*g$Xkdu*jv_mJYw26VR4P%&m+Z3F$WAHqMCW0 zHh);tp~~^VHN1!SdF%8SGZsIv?#^|_mlgTs-Z-fWh^r}{tqWD}mU{==J&&%5U;pPb8e!^mt- zG0VW9d?70`?s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aYUSeG7m~$$2gBY*+61NC;4x>Z`nETF ztm>d$-mg8?A?sbb1J&gMA^4~lZIsV|CmdQGk-x@C?R*e?!qHmTD1bj4Gvvk|1)Q$$WM$uWT6bn+5P|d|l#^V#{v6 zS;2I+wek(bAV@)Qb&)SFHb&l5zm=JEpT&)4)OypIvGiwl#8fAQOF+r*4L_#cTMf9{ zJGuE*+D+J8Xh^5&T2cOTPEo6wNf2oiiu(XdLRaqzaKoQbhlIbhPEv;uYF z8D?nJ_0i3lb|MzxKKAzBX8s3S+DyA?8wPMyG)7$L?e>LSvMO*5zM>8GL)65CJJIej zKQbD_0nXxgamcWFUCE;(J6rcbgz-^u0#^7dqNyxBRiHnth<~2lq1h3ibFgE z^|(09R;6j)L)5_G$zLx|(Id4|qKp##zQ{1r;P)*Ah6Zp6%M}jG8*L(4_O5sE z?yN~PPkQ>ISdr%C&yHf#GbaUHn-p+uS_8_m%p`rry`&Xx%&cJl3qk_sssavis$$l} z>~%##0w&B?Y+|n}#u2k-2PGsRlk^QkDA1`2+SmX;osfVxl78YP?C>sTNNa$Hh?2RK zTLOGY6k-R=%xtNMga$ZC?=X~Km~r@M-}xtE1boK{hu>=eLIW1eM{MH{zUA;g*g*&l znCtX1Yhs7F4Rl+F223S=!B89lIU60rRtU&cf0_NpS6IiAh#4Cd!&V3wGg~~w|FKTR zK_%T_9rr{m*k}X=c!(&OCpPGxGzFg?@v&2L#LObz1%^Rz(1Ll54`w#i0lYS5oT}H4 zDKNK4cf!8}WRgZ4WW}Dq>tkk%brg8Z*Y4Fb!2uxc8%qHxAdD1nh7=G&3OGXw2q6WWAq9kx z0?v>ELU;)QE9N~O@?b}AkX^!10hvzU9L~+msUw2~cpf7@p=Z&@;XQu=#U%PMQMH>y P00000NkvXXu0mjf-s|h{ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-slight-left@2x.png b/assets/navigation/maneuver-slight-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8e80b68446bde54d5e4ce21c4a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(houJD52^b60YCxdSZ?t#CIiF5IXL#R%7Q_j$C=Ho zB^3{-PTudc%&yP(4$61PxmDfBKVLpJV9T1>X5o6|f{j~jnrbtX)}!}3+t!=D?82Aw>`5Oerb!7lnV{UN zuy0?l&B`gvXXJ`BcaB9gT9ovHcM>0%o~&_K*VOMGIX3+{vv_*1#Sl%#q*v=_rJtMQ z63w4Vb$AP2GQ0J;u18*=P(6_#5Aw`I`1tOm@k^4n3yugp_(z6Dz9=Ok2M$AISFh5C zj+?hm?=67KWcvlRoCDH9o-{&;@x+!rD(D)sHZq42=*fu+bIhlkFdfXng+|d>sT0DwotOilOhka>7FvL`5Q6 zyY=?gZha7@sJH=@o?(Pl_MkcCtP@_!GCMD*@F2$?bi!ImvufD{^`tt^2ows}f*NVQmMBkgeRB|d6! z{uPjS(EuOLw8$F>hVK>*$xx&r>%KJby2YcmO9dy1g&{6v?mS*KiE9L^AmQX)9G#(h zr0rZn2lxID&K>X&YBJLsJ$KDcS5rMlz+j{vCp&1=Lo3E5v^KlfZ&X@ey)7g7qJ->i KoG?r)T+H9=YZ_tz literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-straight.png b/assets/navigation/maneuver-straight.png new file mode 100644 index 0000000000000000000000000000000000000000..483018f25603ef578e6b54a8618cc2e15e8bfd69 GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FuHiUIEGZrc{}rT;1L4>mvo~7 zj&lrVOfD=FIyo8B9|R~cP2JtTHtLWyPuBo|_sj*Y)gq+*jIYCo_7H#xT_r5wMi}l{hxK}G?O`3F9VM6@7t}7qf z4w&xk)@oeu@J2()Jmu`_RceK5EM6@QjRG2iOl(dITsR~+8if=S6z~atlxLZ@!g|v) z$;RqiQ^S}%_3HETLceO9GZ8#7M^(-vEvvBR8FO*zE5kaW#XP`ZW$<+Mb6Mw<&;$VU C@RHd8 literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-straight@2x.png b/assets/navigation/maneuver-straight@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..241d85ed933878406493a2bc1ef431480f6f3633 GIT binary patch literal 747 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>VA|yA;uumf=k48#zIOryS|9Ed zRZ+DNWhviK;>20TswjFxHNeTLfv60vB;D#mq@?Gkv+LwhBJC#O`Z@4&1X+YN*g)0R&*V(7nr^#9y>d#Aqa+~8sq$-L+2%bVVnT~d=F4zulX znQ=373D<$gf1Iq;Z&O{Zlm&}Gqjt{|^|w}rTj zbE6KUA4t`lMaMio{$S2d5^+;HlOvf4QgnG9#Kx8mtA4CaYBZX*4yI1lgy) zoaaOH*NG<+6c4C>J8A0H#Gw6}dGf*U*P_IkdM7FzP*mDy_=>}RW+Owmq5}7aAeP-d z_y4on9=m?+R;tJYh9o|PXM>BF%ESWdWO&?#|2EmP2LS$d18}Sb3{%^jHtO&eD1eb^lS4M z6Z;jKPjEP-uqtd~x*#mue>{KI>5dmA-f49gFX=JZPWqrT%k%q&W`VO&RRRrVoaY4u z>tD-dpEui0fMm*3rS-l=4@>QpN$Rfq1hOMm0p8E0)>!cgK>(N^*6 zpF>?AZ zk1Va-vqo2{{#4NQ9HuQ9YI84xR8BVK2C4iBQt38-lNwB=U$n`uDNEPwWXZVbv+MdB z1&7VsR?cEpv2osW4{YeXP0JXdhWbXEd;=<-30Artth93$BS`68u&MJlslk-`N1J>C zD*Xjk`W>wF)hc$7()%E#r{-^31$97;PjtvXpwe4lrTt)~r&h57mDbz=DfODaNeilU zj(c$WRl&zuEODvv5Teu^?ioi^{2YnRBYy^UHuxE7A*pD z>J6}=ldL%|tkK<+#0ZSrr*^TwkLi5T)E1iXp=4I*b$8j^z!$;Oc0CeW;A;Fb>s5Bz zKgrfmtp$shZOdbQVV)Z}mFq>=XV389a;7Vp-K#=Caewv7^(UOw`~5of7XQ(|IQQM| z4`*&Y(h|FntobH>Y%S1&qSUOEXo6)#@s{);_e@%i<0-fA=f3n>OqS3j3^ H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sGgSWWxw) z5JbJonRW$VtrlFJqh~~15rforFFdmu%jw8f`1^_Wv7ZjqLqdqbR$ui}ZjGk$o>C(F zGO~c)WbLpxagL4#ckJn~LGj3?0&28KPOzyzM8)Ci>%+ds0;pN}^y2gNnQrT=(5volP^86S6T{mpW)%9pmCJ5ivb4xN?BswcKLx!KTF%$ zy8YW?+R zj|uI6<`bN{P1Fvj9CiTY^&jjv^mH&NJ%xGh^n`Raf5+(?E(eFWjR-qAeFDcKyl)GbVun(|GetRi?bmm}7rwyAX> zJf8suDvg7BU$~=$GM#JKriM7^)XP1+z0dfyr98twGmKqKP!gR0pUneZe90o?UJ2Q> zXHELuB~a?40@if5WyTLZmU&J?Vnh=}XjGsSw!V|=nRs-vbh&%Syj(Az1XD^PRX8D9 zV#*e1OUq4B=E`99blQaC$(}B+w-R)Wa=(W{SF`2oJ!I0PHZP?{5j|&IY??{BfxaRx zI1QITCrTNk?l8+VZ;NnPz)1K<`~@(&nq=gkh9*qrA`7fuoUz@xd!mrxhlWFf*XOIR zbu@t9QGb5FGi!`#YS3{|;qc7HRu1iO|4&x@ml*k^emkT#ud^6magc9-pZ7&Crf1~M F-vKe_QJw$* literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-unknown@3x.png b/assets/navigation/maneuver-unknown@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..010fe8088f0f094c98c860c85d1ac3eb99d77083 GIT binary patch literal 2757 zcmb_e`#%%<8`o-LBbN=yT`rqzE*&(NSz|=|ZW_7emdjMX5$sp6_{`zu^4v`Fvi_^ZLA==ktDlp6C5~@^Dy;Jm>&O zN=i!J(*x}zIqCmfGSZTL-hKL^loaTSC)$;eRJL6H;ruIiDD_k0V-H}JiHtAhG059j zu^BL|f^K+B02-Mpo}%=CvI${az)=<0r1S{7nxhXUbCMR)Y+?%11IP*rs+I!3^P0Ou zbf0Fc@vWwS3EoK*O~^lKvLKtAn`&dbPcW*U5^B*u*!6pt`l}a?yW)-Xl?6rld~{mK z&Cok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ZKG0Z4w{HTTiMKbu?#RGCzx6MwM}TtyZls0wY3yuqQ~Ag7S$t9`nW9r z%)=gZq(tX9Bxd=ztS7YNzjSX2bHzL0UPlW8~AS&ubPq7}K?OA0h#G+XilsspLcmMk!#v!4 zwdbgIC5Jj@Ph{U6D8w@~0k=-u@dZ8yUHZJ_1I+q1#4D6iqlaFXju`_%iW8Eyg`^0* z5i%Cik@WoUT;r8fzQ#imp{1;-D$nzO6?;P}w;G#v;2SDYk|>DrJcKDOL(ywVA<}T$ z$xF*4&wmrTbtN;%fw*_nS>eJdmf~A;nk&^pwuP?U%an-q4{K-^=|%8#xj2>r*u(8{ zX8D`7RWENF`hP$zmK*=2!a5*EIELd?o_6fhzgGidU?SACQpgh4KZZ)qVT<%8f)~Mp z5~xqQ%7Z?{OzVSgoW=RlSOx6pBN#4&b^rFhBR>VzrF*TxWW${xb)zlxuMLNL;>veG zkKnirF_`00l~y1hc=q=o=d=8#ZZW8>#}(1_A?4VlB(32eT5Yb>4Pz}^pHeI-l=aP1 z{Y+LjUi<9F{a@;lyPU7U{X8b}7w5;SQHzs**b7XVIzpAZ;wq`DJnN-n(`hQV!S@DLX6sgZti}LN z$ZIuY(x+H@=aHtg6Vq94gD{o{c*^7E&Sc#$nDD1B1u{5W6WEYuP!)K@cpvfT`Hinc zob55#5H!f6kz5P@DE3o)0+-A+;{c}|>wXR^c--a5FBocku}AF2*IN9S8kRStE}tP8 zoEGhtkCSVgdKrZT9J9Jh59)yABz!A`3&f`-+#ucX+B@4ds{jY1E@XkMCH*uH{H|o> dpEY-OnTO2%hI{uuTr!?YdAecI_fTP({{_Bw2oeAQ literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-uturn-left.png b/assets/navigation/maneuver-uturn-left.png new file mode 100644 index 0000000000000000000000000000000000000000..7e8d2d8e9d1fdd00758016933427fea87d1ffe88 GIT binary patch literal 666 zcmV;L0%iS)P)g!|DzIEZ;tog!IV!N|fDTLtmZ%FH(SyKvD0g#L_8P>P27%UV)_ z7L<9yFNUFL2tJhb4P`oylk~;R*17=E1qgpD=>a9EE*o@5iSLRessQ0LNk362V>5G# zAh-bG6YLoc70z1Hh!Pt-2tz?oAjhW2#}X}2fl@RV#|w!p4Yl^@Jb@WzA|a60}_F3l{{8DeIA^aUy`twxBLSs#6Y z3QMaIB4*Y{U!cO$YJ`ZH_0boou(TQ>VrG4uEWl&WSc+mO2sgrCVW(4z1=f-VD25f` z{`?Wx>C|F@O#W}3O&Afbz+YjfQ(FZ}creGND1^Bke9L5?Q_BSstUv?QgcYGud=K_H zwOOEqM>91)r4gYDd=GXxwOycuhjXm%Db4NRbat@EsiOi3R-geo#fmT~?u9*0T@)zc z@l5AWX+)R;_reaRt_qY8AjjT1rMbOvIy;zm>bO9H6=;B}tO$|fCt=>H%K{~Y$aH*4 zBSIATNtku&xb31c7JD79&AO#Z433xokYQdb-M<@_VU*LegKvVvQ0t@U0 zRe3VATLsWXflSB$L&nzT&+D=LE-^zTd1&~OUw|1~Kq;8wpF literal 0 HcmV?d00001 diff --git a/assets/navigation/maneuver-uturn-left@2x.png b/assets/navigation/maneuver-uturn-left@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..602dc3d5beb104afa0db7abe22e727d28e85421d GIT binary patch literal 1287 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U^(aM;uumf=k1(_fy(XzZo8E? z$TYgLhzT+X{?KFU=Gf!%;3mfr*91#unS*cL8uXf!Sz=j!_;#*btt)GAsc+l&Eq_<- zdsY9%$Nu6ZhXs#jJYwo8WIVQmAvvbOQ15_*ctQ`i!7)~e$LPXm{8bXy!!L z&YTm|I#z9)GM`IzackpwR~5d$hrNp`Dm+)O@;54S(|nNnp?>nxFUh(}Tl*r8tY9(t zA(`qrEofSG(CSyythC&e8y@Ow%s<&Pr%88b;8osIlO89A!||uyO|(~Dp5py(!iH%R z6Z9UW{`fyZap%>E9tNTbCV!5s?Q>|F$SSoMUtFWQF=~^l zc-D_sC%g_sx%^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EY51|}qZ|KwA~d5sDhIP9 z=YEjIh=ngJdhJNeoZPC?IF}yBs~;f=V=0aXJ;P4+7_pptAx*er^;Yg08q0=xyrTprDY)(+Sy%%WlkIm6sCypTIpG)qGQly?;zc{&dmo^sRwc;iFt8`;u;y1=m=t*olvW1L_h(he2;T(r-Jh@k>^FLkHv=$+%{1T zzdlgcC+_Lh<#OYKVBj0cvD6-Pen#{dl@`qJCPIC8lkI|RBnYE<`T+Gxam^14pn_Zl zEc2_b$A9fF@=NB}oIG}K_VNUGM?IL4u7mCXP!QSfE#VFsoF8!X4tdLLGy{NCuuOHr zTn_-n0nqMyi~okog7cC9s1tzf$#x|kk^qa5H$jqs^)GE|O_js#2kW|z)@uL>ZUl-T zZ)QTLD#L6|R#32-%R^(Ie(B2!CH)+zz^j7wN;+alqXn-3U2U*s#ptZC zUsMPHPhSAGPyXs#*+h*%RK~rOTvdv%tDwqZFT~}7>sJ6#3w?kBi=BscJ?1}bs`-7( zp$6PpFdMq_(_3H~c#^pWB&uVbRl6Vo1y4@{PNaC%>74Lq1@HQOtAy`&lj@8Zsw)2M zAR#NaJ1gMA@)_T{`9zf?P>elL%yPv{Jn&n{OS_$GMR)CsfbNan$TE!A$n3U{l>SK3 z$maccxj?cumUh+U79B{Y>(ys3A!~xPfW?x0NuhoZMYtF&h-S6ThL`&V7z;z_ztoagL*up{?AdDSdd_R3KsV`K(Fu_B8QK^poocU(_`B`*B(4I&xGqlZhgm=+> rVox7|&q7!^DJoHuEHrVF@?hCQ6uWnHSu{ol9&0@kfsDT!mR9yJI$eHO literal 0 HcmV?d00001 diff --git a/assets/navigation/oneway-dark.png b/assets/navigation/oneway-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..1bfed0a087634a56bcc9fcf186d6cc949a35b6b1 GIT binary patch literal 239 zcmV;{sTzY{|X zS+l^oTgLpkqot-fmMBRk1=jW#BCgO9Gk0x!I#YtAz`1^pL%-Yq7_%+w`ry$jB0-4$ zM4Lm>8MDcdp~BjyMu`L>`U?k&AoN)87{c)=N+6@l$Wz}3l)&2S8zsl)=q8a&jWQN^ pl;PP56h#>2K|uajf;p@}@CBLHUlGwmuT}s6002ovPDHLkV1hZ1W0U{@ literal 0 HcmV?d00001 diff --git a/assets/navigation/oneway-dark@2x.png b/assets/navigation/oneway-dark@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6019dcef949ffa4a9f2af64a9c0b3b2ad0a6a445 GIT binary patch literal 399 zcmV;A0dW3_P)C2J0eV^fr!F{9s@v4!j1qWX>g9+U`SIGkh-* t^yk+?ikx5i&U+2qiew-eNCxh1;2)U!vmpt1e2f49002ovPDHLkV1h+2sdoSX literal 0 HcmV?d00001 diff --git a/assets/navigation/oneway-dark@3x.png b/assets/navigation/oneway-dark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..91ae3efc8a48d5f87590bed53568665813afb79f GIT binary patch literal 549 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(Fuw70aSW-L^LEm~z{3Utu3O#x zTDaZ_Ent4Z($~VgF_>Xt!;yy$MJ;{{n0K@6W|}1I{@M0%!$eWfuxWxbFV4PsQBEi_ z|NCT%qNav?6m-CDQ_j?@TX%>#^>iFD@;t^_Rrb#%VPk}T>x%am%N8s***kYZVr#6z z>1)$VWA`t7>*x~hS@c^^B2o0jrs;vP_0KYr7cNt=+UYTAHgA;}$I&(`E2BMuNx~Og z-P?@4beP00PSo7F$Yn+I#_m2I|0#T81}@8;OkGyU$pk7*F<$nDXAl|PR ze_W1yE7!B&p0TL;c4k>I>n)C}%_6gn4LugrI`o-|aplM*NH}yd@^lF;T=TGt;kqsF zHKw+cp)>B>dvRjRY@G{kE96o(o|Fw^ddptCWn+NBlV)okW=%tZ)f$4QIG&%{{o-Bg zoyR3r=E7_`tYPvNZW=SWCU5HN^VxlqDYs?P%_T2?@GKXLZshF?zM_9Z(aLC+My{g4 zp_NCy671^dJ>1BjVZFoM-Az>0c!uRv1=*w5Z=-dm)oAK`yrl_X&*AO ctZLMM@kq&G!K#Jdfzi+4>FVdQ&MBb@0QpqpD*ylh literal 0 HcmV?d00001 diff --git a/assets/navigation/oneway-light.png b/assets/navigation/oneway-light.png new file mode 100644 index 0000000000000000000000000000000000000000..74543dcdeace6d9674dd81ec66a7b9d2a1d4ee6b GIT binary patch literal 247 zcmV>O39}A{ xWc-u>urn}xTb;p}q&ww)BFLXJz%N<=;0Z^XQ4!Mu((nKP002ovPDHLkV1lXDU#S29 literal 0 HcmV?d00001 diff --git a/assets/navigation/oneway-light@2x.png b/assets/navigation/oneway-light@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a283265fbdefc5638b78b7935f75a16c7cbf365b GIT binary patch literal 396 zcmV;70dxL|P)Z)oiSkk{HimW~^eq#u!YLfTenq=v71sSgQX+ zItoM+w+cpruvOnxjtAL34_!r&fTQ|vDHkIGLQESXdPRDIR}my&s~#_S?q8qsFty q2`%FM*md41a4oVx7RUlO7dQYyPP-wEwLk9w0000o*WW%g4bvH_v^Rce%HRm)_m~h*`$wOj&UfODztEX`lIbCy|L_G`{B>p zHQOEinc7cS2+2xb(wHb2;OgFHg>9Cyb9p*mF>2oG*qZQ( z;Vgrdd#CfU0M~|BbA*zaXPwkstgO7sH!Z_?MdL}eatTR+tF0iV7oHxHoz*A-R2!uc z9_L=F_xz2a=d-3v1Je(kLJmfA7Xfvh1?uuhYd#pWK+Di{gQKJq`wbU&H^HScY)m1l zZfuV#)Vi8%7p&cUj5Ybny#xpCDS}(tO`KG>dKby`?f3lBUjDG$BYBIe{<6b{W*_2_ jV&Q>Q{sB|<{0HpsxCI@i81=gYBcH+3)z4*}Q$iB}ILqNC literal 0 HcmV?d00001 diff --git a/docs/development/navigation.md b/docs/development/navigation.md index 5f37a04..6838652 100644 --- a/docs/development/navigation.md +++ b/docs/development/navigation.md @@ -23,6 +23,20 @@ Road guidance consumes one [packaged policy](../../modules/avoid-navigation/andr The [host trajectory harness](../../tests/navigation-core/README.md) executes the real Ferrostar 0.57.0 Rust controller against that policy. It covers sparse turn samples, sidewalk offset, progress/deviation at accepted accuracy and a short final step. It does not execute the Android library or UniFFI/JNA bridge; Android runtime and physical-route acceptance remain separate. +## First-person guidance presentation + +Road guidance uses an app-controlled MapLibre camera fed only by accepted native navigation state: no second location stream and no MapLibre user tracking. The native snapshot exposes, besides the Italian text, structured maneuvers and kinematics (`src/domain/navigation.ts`): + +- `upcomingManeuver` (Ferrostar's `remainingSteps[1]`, whose text is `instruction`) and `followingManeuver` (`nextInstruction`) carry the raw OSRM type, modifier, roundabout exit, street name/ref, bearings, driving side, maneuver coordinate and its index in the route geometry. Ids are `:` and change on every reroute. `followingManeuver` adds the distance/time between the two maneuvers. Raw facts are kept beside Ferrostar's parsed steps because the adapter empties its visual instructions; Italian prose is never parsed back into types. +- `routeProgress.traveledMeters` is the snapped position measured with the native haversine on the bridged route geometry, so the interface can split travelled and remaining route on exactly what it draws. `snappedLocation` and `alignment` (`aligned`, `deviating`, `unknown` when the fix was too coarse to judge deviation) tell the camera whether the snapped position is credible. +- `location` adds speed, course and their accuracies when the platform supplies finite values, plus the monotonic `elapsedMs` sample time used for fix intervals and duplicate detection. + +The camera planner (`src/features/navigation/guidance-camera.ts`) produces one frame per distinct fix. The map eases linearly to it over the measured fix interval, so the puck (drawn at the camera anchor while following) and the map move on one clock with React rendering at 1 Hz. It is course-up with circular filtering (the short way across north) and holds its bearing when slow; pitch, zoom and the puck anchor are per mode (walking 34°, zoom 18.3, 67% of the map left between banner and strip; cycling 42°, 17.1–18, 71.5%; driving 48°, 15.7–17.7 by smoothed speed, 73.5%). The anchor is placed with top padding: MapLibre centres the padded rectangle, so bottom padding alone would raise the puck. Turn framing starts 8/10/12 s before the maneuver (walking/cycling/driving), keeps the junction and a short outgoing path (and a second turn that follows within about ten seconds) inside the visible map, and releases over 2–3 s. Cycling and driving draw at the route-snapped position only while `alignment` is `aligned`; walking keeps the real offset. Cycling and driving add a presentation-only lead of at most one fix interval that never passes the upcoming maneuver and stops on degraded, late or recovering fixes; it never feeds navigation state. When a provider omits speed or course, the planner derives them from consecutive accepted fixes for presentation only. + +Camera intent is follow, free or overview. A gesture enters free at gesture start (`onRegionWillChange` with user interaction) and blocks every pending move; **Ricentra** restores the follow pose in one 500 ms transition; overview frames the remaining route north-up and flat once. Fixes and reroutes never take the camera back from free or overview. + +Development builds log `[nav-cam]` rows comparing MapLibre's own `project()` of the camera centre and the next junction with the planner (anchor error, projection error, commanded versus native zoom/bearing). Emulator replays (`adb shell cmd location providers set-test-provider-location` at 1 Hz) exercise this path; physical-device GPS, frame pacing and battery use remain separate acceptance. + ## Android acceptance Build and install following [android.md](android.md). Record version/code, Android version, permissions, installed voice and network state using public routes/stops. Each row above needs an observed result for its affected mode; provider failure is an explicit outcome, and an install alone is not runtime acceptance. diff --git a/docs/development/ux.md b/docs/development/ux.md index 58a6834..547afa4 100644 --- a/docs/development/ux.md +++ b/docs/development/ux.md @@ -53,7 +53,7 @@ The app belongs to the avoid.quest family. Launcher name: **avoid maps** (develo Keep one map mounted across browsing, sheet expansion and navigation. Small inset task cards overlay that viewport at a compact height or an explicitly expanded height; keyboard resizing may reduce the sheet's available space while preserving the map. Status, loading and error updates change content inside reserved regions. Anchor route actions outside scrolling details, and keep navigation instruction, trip summary, Retry and Stop geometry independent of position quality. -Frame a planning route once for the requested origin, destination and mode, or when the user selects an alternative or requests the full route. Refreshes update its line without reframing. Panning consumes any pending frame so a late response respects the chosen view. Camera padding must leave visible map space on narrow, expanded and side-sheet layouts. Navigation follows accepted positions until the user pans; Locate deliberately resumes following. +Frame a planning route once for the requested origin, destination and mode, or when the user selects an alternative or requests the full route. Refreshes update its line without reframing. Panning consumes any pending frame so a late response respects the chosen view. Camera padding must leave visible map space on narrow, expanded and side-sheet layouts. Road guidance uses the first-person camera described in [navigation](navigation.md#first-person-guidance-presentation): a gesture enters free at its start, **Ricentra** restores following in one move, and the overview button frames the remaining route once. Fixes and reroutes never take the camera back. Keep current quality separate from retained coordinates. The native snapshot supplies the last accepted accuracy and current usability/problem, not the accuracy of rejected samples. Label retained numbers **Ultima posizione accettata** and paused maneuvers **Ultima indicazione**; keep their geometry while guidance is suspended. Provider selection and accuracy/age policy are separate concerns. @@ -65,6 +65,12 @@ Trasporti lists the nearest pilot rail stations above the GTT stops; a station o ## Active guidance +Road guidance is first-person: a flush banner in the chrome colour on top, the map with the puck low in the space between banner and strip, and a compact bottom strip. + +- **Banner:** a maneuver glyph drawn from the OSRM type and modifier (straight, slight/normal/sharp turns, U-turn, fork, merge, ramps, roundabout with exit number and circulation, arrival; an unknown maneuver shows a neutral glyph with the supplied text, never a guessed turn), the distance in heavy Mona Sans with a smaller unit, then the street and the action in Geist with two lines reserved. A reserved row shows **Poi …** only when the following maneuver comes within about ten seconds of travel after the upcoming one; otherwise it holds the status (**Ricalcolo del percorso…**, **Fuori percorso**, reduced precision, **Guida in pausa · Ultima indicazione**, the search signal). Status never changes the banner height. +- **Strip:** arrival time labelled **arrivo stimato**, remaining time and distance **senza traffico**, the voice toggle (active, muted and unavailable are distinct icons and labels), overview and **Interrompi**. Tapping the summary opens details. **Riprova** appears only beside an active problem. A paused position never advances an apparently current arrival time: the strip shows **Stima sospesa** and labels the remaining values as the last estimate. +- **Map:** the remaining route in the brand ink with a contrasting casing, the travelled part thinner and muted, one cased arrow through the next junction from the real geometry, and the puck (a wedge with a live green centre, a disc when the direction is unknown, a subdued ring for a retained position). Driving and cycling hide generic business dots and labels but keep street names; driving shows one-way chevrons. + Prioritize the next instruction, map, current problem and Stop action. Present recovery beside the problem. Keep voice status and setup in navigation details. Anchor the active transit confirmation beside Stop. Transit following has its own screen, not the road panel: the stage and instruction on top, the next boarding with its live provenance (or **Corsa non confermata**), the stop to get off at, journey age and passed/missed warnings, then the remaining timeline; the large confirmation sits beside Stop. Preserve transit confirmation controls and uncertainty when simplifying the layout. Route previews remain planning; native voice, position and background behavior require the separate [navigation acceptance checks](navigation.md). ## Task model and modules diff --git a/src/features/app/AppMap.tsx b/src/features/app/AppMap.tsx index 3fb1b18..d681a3b 100644 --- a/src/features/app/AppMap.tsx +++ b/src/features/app/AppMap.tsx @@ -68,7 +68,7 @@ export function AppMap({ height, padding, attributionLeft, attributionTop, guida const navCenter = navigation.snapshot.location ?? navigation.snapshot.destination ?? camera.center; const navigating = navigation.visible; // Road guidance: the app-controlled first-person camera; the map never follows on its own. - const guidance = useGuidanceCamera({ snapshot: navigation.snapshot, camera, viewport: guidanceViewport, active: navigating }); + const guidance = useGuidanceCamera({ snapshot: navigation.snapshot, camera, viewport: guidanceViewport, active: navigating, transitPlan: navigation.transitPlan }); return ( location.message ? location.setMessage("") : feedback.dismiss(); // Measured guidance chrome: the camera places the puck inside the map left between them. const [guidanceChrome, setGuidanceChrome] = useState({ top: 120, bottom: 190 }); - const guidanceViewport = useMemo(() => ({ width, height: mapHeight, top: Math.min(guidanceChrome.top, mapHeight / 2), bottom: Math.max(mapHeight / 2, mapHeight - guidanceChrome.bottom) }), + const guidanceViewport = useMemo(() => ({ width, height: mapHeight, top: Math.min(guidanceChrome.top, mapHeight - 160), bottom: Math.max(Math.min(guidanceChrome.top, mapHeight - 160) + 120, mapHeight - guidanceChrome.bottom) }), [width, mapHeight, guidanceChrome]); const onGuidanceChrome = (top: number, bottom: number) => setGuidanceChrome(current => Math.abs(current.top - top) < 1 && Math.abs(current.bottom - bottom) < 1 ? current : { top, bottom }); const overlayPosition = { bottom: !wide && panelVisible ? currentSheetHeight + 24 : 88, left: wide && panelVisible ? SIDE_SHEET_WIDTH + 8 : 16, right: 16 }; @@ -77,11 +77,11 @@ export function AppShell() { height={mapHeight} padding={mapPadding} attributionLeft={wide && panelVisible && !navigation.visible ? SIDE_SHEET_WIDTH - 4 : 8} - attributionTop={navigation.visible ? Math.min(height * 0.3, 104 * Math.min(fontScale, 1.5)) + 8 : 68} + attributionTop={navigation.visible ? guidanceViewport.top + 8 : 68} guidanceViewport={guidanceViewport} /> {navigation.visible && (navigation.snapshot.mode === "transit" || (navigation.busy === "start" && navigation.startKind === "transit")) ? ( - { void navigation.stop(); }} onRetry={() => { void navigation.retry(); }} onConfirm={action => { void navigation.confirmTransit(action); }} onReplan={() => { void planner.replanFromNavigation(); }} onMute={() => { void navigation.toggleMuted(); }} /> diff --git a/src/features/map/GuidanceMapLayers.tsx b/src/features/map/GuidanceMapLayers.tsx new file mode 100644 index 0000000..a863970 --- /dev/null +++ b/src/features/map/GuidanceMapLayers.tsx @@ -0,0 +1,65 @@ +import { useMemo } from 'react'; +import { GeoJSONSource, Layer } from '@maplibre/maplibre-react-native'; +import type { LineString } from 'geojson'; +import type { MapColors } from '../../theme'; +import type { ColorScheme } from '../../theme/palette'; +import type { ManeuverArrow } from '../navigation/guidance-route'; +import { remainingGradient } from '../navigation/guidance-route'; + +/** Route and turn arrow sit under street names, so labels stay readable over the line. */ +const BELOW_LABELS = 'highway-name-path'; +/** Generic business dots and labels: hidden while driving or cycling; street names stay. */ +const POI_LAYERS: { id: string; type: 'circle' | 'symbol' }[] = [ + { id: 'avoid_poi_dot_r1', type: 'circle' }, { id: 'avoid_poi_dot_r7', type: 'circle' }, { id: 'avoid_poi_dot_r20', type: 'circle' }, + { id: 'poi_r1', type: 'symbol' }, { id: 'poi_r7', type: 'symbol' }, { id: 'poi_r20', type: 'symbol' }, +]; + +const EMPTY = { type: 'FeatureCollection' as const, features: [] }; +/** + * Basemap adjustments during guidance: generic business dots and labels hidden while driving or + * cycling, one-way chevrons (a hidden brand-basemap layer) shown while driving. The style layers are + * adopted as children of an empty app source because MapLibre RN re-adds sources, and with them + * their layers, after every style load (a live theme switch); standalone adopted layers would go stale. + */ +export function BasemapGuidanceAdjustments({ reduceBusinesses, oneWayArrows }: { reduceBusinesses: boolean; oneWayArrows: boolean }) { + const visibility = reduceBusinesses ? 'none' : 'visible'; + return + {POI_LAYERS.map(layer => layer.type === 'circle' + ? + : )} + + ; +} + +/** + * Guidance route: a thin muted full route (the travelled part shows through), the active remaining + * route with a contrasting casing cut at the snapped progress, and one cased arrow through the next + * junction. Progress changes only paint, never the source geometry. + */ +export function GuidanceRouteLayers({ route, fraction, arrow, colors, scheme }: { + route: LineString; fraction: number; arrow: ManeuverArrow | null; colors: MapColors; scheme: ColorScheme; +}) { + const data = useMemo(() => ({ type: 'Feature' as const, geometry: route, properties: {} }), [route]); + const arrowData = useMemo(() => arrow ? { type: 'Feature' as const, geometry: { type: 'LineString' as const, coordinates: arrow.shaft }, properties: {} } : null, [arrow]); + const headData = useMemo(() => arrow ? { type: 'Feature' as const, geometry: { type: 'Point' as const, coordinates: arrow.head.coordinate }, properties: { bearing: arrow.head.bearing } } : null, [arrow]); + const round = { 'line-cap': 'round', 'line-join': 'round' } as const; + return <> + + + + + + {arrowData && headData ? <> + + + + + + + + : null} + ; +} diff --git a/src/features/map/MapCanvas.native.tsx b/src/features/map/MapCanvas.native.tsx index 0f366a5..9af610f 100644 --- a/src/features/map/MapCanvas.native.tsx +++ b/src/features/map/MapCanvas.native.tsx @@ -9,6 +9,7 @@ import type { MapCanvasProps } from './MapCanvas.types'; import { createOnceFraming, createRouteFraming, frameCamera } from './map-presentation'; import { lineLayout, markerLabelLayout, overlayPaint } from './map-overlay-style'; import { GUIDANCE_IMAGES, puckImage, puckLayout } from './guidance-puck'; +import { BasemapGuidanceAdjustments, GuidanceRouteLayers } from './GuidanceMapLayers'; import { useGuidanceCameraDriver } from './useGuidanceCameraDriver'; /** @@ -40,12 +41,17 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi // (including after a pan) moves into the newly visible area instead of under the sheet. const { top = 0, right = 0, bottom = 0, left = 0 } = cameraPadding ?? {}; const guiding = !!guidance; + const leftGuidance = useRef(false); useEffect(() => { - if (!loaded || followLocation === true || guiding) return; + if (guiding) { leftGuidance.current = true; return; } + if (!loaded || followLocation === true) return; + // Right after guidance the browsing map also returns to north-up and flat. + const pose = leftGuidance.current ? { bearing: 0, pitch: 0 } : {}; + leftGuidance.current = false; let current = true; const issued = commands.current; void map.current?.getCenter().then(center => { - if (current && issued === commands.current) camera.current?.easeTo({ center, padding: { top, right, bottom, left }, duration: 250 }); + if (current && issued === commands.current) camera.current?.easeTo({ center, ...pose, padding: { top, right, bottom, left }, duration: 250 }); }).catch(() => undefined); return () => { current = false; }; }, [loaded, top, right, bottom, left, followLocation, guiding]); @@ -72,7 +78,7 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi // Free, overview or a paused fix: a map symbol at the accepted (or retained) position. const frame = guidance?.frame ?? null; const followPuck = guidance?.intent === 'follow' && frame !== null && frame.puck.kind !== 'retained'; - const mapPuck = guidance && frame && !followPuck ? frame.puck : null; + const mapPuck = guidance && !followPuck ? guidance.puck : null; const overlayPuck = followPuck && frame ? { source: GUIDANCE_IMAGES[puckImage(frame.puck.kind, theme.scheme)]!, x: frame.anchor.x, y: frame.anchor.y, rotation: frame.puck.heading === null ? 0 : frame.puck.heading - frame.bearing, tilt: Math.round(frame.pitch * 0.55), @@ -94,7 +100,9 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi } - {route && + + {route && guidance?.route ? : null} + {route && !guidance?.route && } diff --git a/src/features/map/guidance-puck.ts b/src/features/map/guidance-puck.ts index 02b5c9c..e26421a 100644 --- a/src/features/map/guidance-puck.ts +++ b/src/features/map/guidance-puck.ts @@ -13,6 +13,10 @@ export const GUIDANCE_IMAGES: Record = { 'puck-dot-dark': require('../../../assets/navigation/puck-dot-dark.png'), 'puck-retained-light': require('../../../assets/navigation/puck-retained-light.png'), 'puck-retained-dark': require('../../../assets/navigation/puck-retained-dark.png'), + 'arrowhead-light': require('../../../assets/navigation/arrowhead-light.png'), + 'arrowhead-dark': require('../../../assets/navigation/arrowhead-dark.png'), + 'oneway-light': require('../../../assets/navigation/oneway-light.png'), + 'oneway-dark': require('../../../assets/navigation/oneway-dark.png'), }; export const puckImage = (kind: PuckKind, scheme: ColorScheme) => `puck-${kind}-${scheme}`; diff --git a/src/features/map/useGuidanceCameraDriver.ts b/src/features/map/useGuidanceCameraDriver.ts index 7ad6638..56e37f1 100644 --- a/src/features/map/useGuidanceCameraDriver.ts +++ b/src/features/map/useGuidanceCameraDriver.ts @@ -18,8 +18,10 @@ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, command const intent = guidance?.intent; const frame = guidance?.frame ?? null; const overview = guidance?.overview ?? null; + const fit = guidance?.fit ?? null; const issued = useRef(null); - const overviewIssued = useRef(null); + const overviewIssued = useRef(null); + const fitIssued = useRef(null); const gestureActive = useRef(false); const latest = useRef(guidance); latest.current = guidance; @@ -32,7 +34,7 @@ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, command center: [frame.center.longitude, frame.center.latitude], bearing: frame.bearing, pitch: frame.pitch, zoom: frame.zoom, padding: frame.padding, duration: frame.durationMs, easing: frame.easing, }); - if (ASSERT) assertFrame(map, frame, size.current); + if (ASSERT) assertFrame(map, frame, size.current, latest); }, [loaded, frame, intent, camera, map, commands, size]); useEffect(() => { if (!loaded || !overview || intent !== 'overview' || overviewIssued.current === overview.key) return; @@ -40,7 +42,14 @@ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, command commands.current += 1; camera.current?.fitBounds(overview.bounds, { padding: overview.padding, bearing: 0, pitch: 0, duration: 700 }); }, [loaded, overview, intent, camera, commands]); - useEffect(() => { if (!guidance) { issued.current = null; overviewIssued.current = null; } }, [guidance]); + // Transit without a usable fix: frame the current leg and its stop once per leg (flat, north-up). + useEffect(() => { + if (!loaded || frame || !fit || intent !== 'follow' || gestureActive.current || fitIssued.current === fit.key) return; + fitIssued.current = fit.key; + commands.current += 1; + camera.current?.fitBounds(fit.bounds, { padding: fit.padding, bearing: 0, pitch: 0, duration: 700 }); + }, [loaded, frame, fit, intent, camera, commands]); + useEffect(() => { if (!guidance) { issued.current = null; overviewIssued.current = null; fitIssued.current = null; } }, [guidance]); return useCallback(() => { const current = latest.current; if (!current) return; @@ -54,11 +63,12 @@ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, command * Near the end of the move, compare MapLibre's own projection with the planned anchor and framing: * the camera centre must land on the anchor, the junction and outgoing path inside the map. */ -function assertFrame(map: RefObject, frame: CameraFrame, size: { width: number; height: number }) { +function assertFrame(map: RefObject, frame: CameraFrame, size: { width: number; height: number }, latest: RefObject) { const issuedAt = Date.now(); setTimeout(() => { const ref = map.current; - if (!ref) return; + // Guidance ended or the camera left follow: nothing to assert. + if (!ref || latest.current?.intent !== 'follow') return; const puck: [number, number] = [frame.center.longitude, frame.center.latitude]; const junction = frame.framing?.points[0]; void Promise.all([ diff --git a/src/features/navigation/ManeuverGlyphImage.tsx b/src/features/navigation/ManeuverGlyphImage.tsx new file mode 100644 index 0000000..016d1dd --- /dev/null +++ b/src/features/navigation/ManeuverGlyphImage.tsx @@ -0,0 +1,37 @@ +import { Image, View } from 'react-native'; +import { Text } from '../../ui/Text'; +import type { GlyphName, ManeuverGlyph } from './maneuver-presentation'; + +/** Single-ink maneuver artwork (scripts/render-navigation-assets.mjs), tinted to the text colour. */ +const GLYPHS: Record = { + straight: require('../../../assets/navigation/maneuver-straight.png'), + 'slight-left': require('../../../assets/navigation/maneuver-slight-left.png'), + left: require('../../../assets/navigation/maneuver-left.png'), + 'sharp-left': require('../../../assets/navigation/maneuver-sharp-left.png'), + 'uturn-left': require('../../../assets/navigation/maneuver-uturn-left.png'), + 'fork-left': require('../../../assets/navigation/maneuver-fork-left.png'), + 'merge-left': require('../../../assets/navigation/maneuver-merge-left.png'), + 'ramp-left': require('../../../assets/navigation/maneuver-ramp-left.png'), + 'roundabout-right': require('../../../assets/navigation/maneuver-roundabout-right.png'), + 'roundabout-slight-right': require('../../../assets/navigation/maneuver-roundabout-slight-right.png'), + 'roundabout-straight': require('../../../assets/navigation/maneuver-roundabout-straight.png'), + 'roundabout-slight-left': require('../../../assets/navigation/maneuver-roundabout-slight-left.png'), + 'roundabout-left': require('../../../assets/navigation/maneuver-roundabout-left.png'), + 'roundabout-sharp-left': require('../../../assets/navigation/maneuver-roundabout-sharp-left.png'), + 'roundabout-uturn': require('../../../assets/navigation/maneuver-roundabout-uturn.png'), + arrive: require('../../../assets/navigation/maneuver-arrive.png'), + 'arrive-left': require('../../../assets/navigation/maneuver-arrive-left.png'), + unknown: require('../../../assets/navigation/maneuver-unknown.png'), +}; + +/** Decorative: the banner's accessibility label already says what the glyph shows. */ +export function ManeuverGlyphImage({ glyph, size, color }: { glyph: ManeuverGlyph; size: number; color: string }) { + return + + {glyph.exit !== undefined ? ( + {glyph.exit} + ) : null} + ; +} diff --git a/src/features/navigation/NavigationPanel.tsx b/src/features/navigation/NavigationPanel.tsx index ea17e48..87d1109 100644 --- a/src/features/navigation/NavigationPanel.tsx +++ b/src/features/navigation/NavigationPanel.tsx @@ -1,19 +1,28 @@ import { useEffect, useRef, useState } from 'react'; -import { ActivityIndicator, Linking, Modal, Pressable, ScrollView, useWindowDimensions, View } from 'react-native'; -import { Text } from '../../ui/Text'; -import { useThemeColors } from '../../theme'; +import { ActivityIndicator, Linking, Modal, ScrollView, useWindowDimensions, View } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; +import { useThemeColors } from '../../theme'; import type { TransitConfirmation } from '../../domain/navigation'; import { navigationLocationForReplan, navigationPresentation } from '../../domain/navigation'; -import { Button, Display, Icon, IconButton, Notice, Num, useHairlines } from '../../ui'; -import type { NavigationState } from './navigation-controller'; +import { Button, Display, Icon, IconButton, Notice, Num, Text, useHairlines } from '../../ui'; +import { PressableSurface } from '../../ui/PressableSurface'; import { journeyDuration } from '../planner/journey-presentation'; import type { CameraIntent } from './guidance-camera'; +import { bannerDistance, maneuverGlyph, maneuverLines, thenManeuver } from './maneuver-presentation'; +import { ManeuverGlyphImage } from './ManeuverGlyphImage'; +import type { NavigationState } from './navigation-controller'; const distance = (meters: number) => meters < 1000 ? `${Math.round(meters)} m` : `${(meters / 1000).toFixed(1).replace('.', ',')} km`; -export function NavigationPanel({ snapshot, busy, error, following, intent, onRecenter, onOverview, onChromeLayout, onStop, onRetry, onMute, onConfirmTransit, onReplan }: NavigationState & { +const clock = (value: number) => new Date(value).toLocaleTimeString('it-IT', { hour: '2-digit', minute: '2-digit' }); + +/** + * Road guidance: a flush maneuver banner on top, the map, and a compact bottom strip (arrival, + * remaining time/distance, voice, overview, Interrompi). Status lives in a reserved row, so position + * quality, rerouting and pauses never move the banner, the strip or the camera's anchor. + */ +export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onOverview, onChromeLayout, onStop, onRetry, onMute, onConfirmTransit, onReplan }: NavigationState & { following: boolean; intent: CameraIntent; onRecenter: () => void; onOverview: () => void; - /** Heights of the top banner and bottom chrome, so the camera anchors the puck between them. */ + /** Heights of the banner and the bottom strip, so the camera anchors the puck between them. */ onChromeLayout: (top: number, bottom: number) => void; onStop: () => void; onRetry: () => void; onMute: () => void; onConfirmTransit: (action: TransitConfirmation) => void; onReplan: () => void; @@ -22,103 +31,153 @@ export function NavigationPanel({ snapshot, busy, error, following, intent, onRe const hairlines = useHairlines(); const { width, height, fontScale } = useWindowDimensions(); const [detailsOpen, setDetailsOpen] = useState(false); - const banner = useRef(120); - const strip = useRef(190); const [now, setNow] = useState(Date.now()); + const banner = useRef(0); + const strip = useRef(0); const transitMode = snapshot.mode === 'transit'; - const cues = snapshot.locationUsable === true; const waiting = busy === 'start' || snapshot.status === 'waiting-for-fix' || snapshot.status === 'routing' || snapshot.status === 'rerouting'; - const remainingSeconds = snapshot.mode !== 'transit' ? snapshot.durationRemainingSeconds : undefined; - const arrival = remainingSeconds != null && snapshot.location ? new Date(snapshot.location.timestamp + remainingSeconds * 1000).toLocaleTimeString('it-IT', { hour: '2-digit', minute: '2-digit' }) : null; + const remainingSeconds = !transitMode ? snapshot.durationRemainingSeconds : undefined; + const text0 = navigationPresentation(snapshot, now, null, busy === 'start'); + // Only a current fix advances the estimate; a paused position never shows an apparently current ETA. + const arrival = remainingSeconds != null && snapshot.location && text0.guiding ? clock(snapshot.location.timestamp + remainingSeconds * 1000) : null; const text = navigationPresentation(snapshot, now, arrival, busy === 'start'); const { terminal, guiding, paused, searching } = text; useEffect(() => { const timer = setInterval(() => setNow(Date.now()), searching ? 1_000 : 15_000); return () => clearInterval(timer); }, [searching]); const transit = snapshot.transit; - const time = (value: number) => new Date(value).toLocaleTimeString('it-IT', { hour: '2-digit', minute: '2-digit' }); const transitAge = transit ? Math.max(0, Math.floor((now - transit.fetchedAt) / 60_000)) : 0; const replanLocation = navigationLocationForReplan(snapshot); const confirmation: TransitConfirmation | undefined = transit?.canConfirmWalking ? 'walk-complete' : transit?.canConfirmBoarding ? 'board' : transit?.canConfirmAlighting ? 'alight' : undefined; - const voiceLabel = snapshot.voice === 'ready' ? 'Voce attiva' : snapshot.voice === 'muted' ? 'Voce disattivata' : snapshot.voice === 'initializing' ? 'Preparazione voce' : 'Voce non disponibile'; - const source = snapshot.route?.source ?? (snapshot.mode === 'transit' ? 'MATO / 5T' : 'FOSSGIS / OpenStreetMap'); + const source = snapshot.route?.source ?? (transitMode ? 'MATO / 5T' : 'FOSSGIS / OpenStreetMap'); const landscape = width >= 650 && height < 500; - const panelHeight = Math.min(height * 0.46, Math.max(176, 176 * Math.min(fontScale, 1.5))); + const report = () => onChromeLayout(banner.current, strip.current); + + // Banner content: the upcoming maneuver while there is one (kept, labelled, while paused). + const maneuver = snapshot.upcomingManeuver; + const showManeuver = !terminal && !searching && (snapshot.status === 'navigating' || snapshot.status === 'off-route' || paused) && !!(maneuver ?? snapshot.instruction); + const glyph = maneuverGlyph(maneuver); + const lines = maneuverLines(maneuver, snapshot.instruction); + const meters = guiding && snapshot.distanceToManeuverMeters != null ? bannerDistance(snapshot.distanceToManeuverMeters) : null; + const then = showManeuver && !paused ? thenManeuver(snapshot) : null; + const status = snapshot.status === 'rerouting' ? 'Ricalcolo del percorso…' : snapshot.status === 'off-route' ? 'Fuori percorso · ricalcolo se prosegui' + : paused ? 'Guida in pausa · Ultima indicazione' : searching ? text.signal : text.precision; + const statusTone = paused || snapshot.status === 'off-route' || (!searching && text.precision) ? 'text-caution' : 'text-secondary'; + const problem = snapshot.problem && !(paused && snapshot.problem.startsWith('location-') && !snapshot.canRetry) ? text.quality : null; + const showRetry = snapshot.canRetry && !confirmation && (!!snapshot.problem || snapshot.status === 'interrupted' || snapshot.status === 'off-route' || text.searching); + const bannerLabel = showManeuver ? `${meters ? `Tra ${meters.label}, ` : ''}${maneuver?.instruction ?? snapshot.instruction ?? ''}` : `${text.header}. ${text.instruction}`; + const voice = snapshot.voice === 'ready' ? { icon: 'volume-high-outline' as const, label: 'Voce attiva. Disattiva la voce' } + : snapshot.voice === 'muted' ? { icon: 'volume-mute-outline' as const, label: 'Voce disattivata. Attiva la voce' } + : snapshot.voice === 'initializing' ? { icon: 'volume-low-outline' as const, label: 'Preparazione della voce' } + : { icon: 'volume-off-outline' as const, label: 'Voce non disponibile: nessuna voce italiana offline' }; + const glyphSize = Math.round(44 * Math.min(fontScale, 1.3)); + // Height of the 42 sp distance line; every banner state reserves it. + const firstRow = Math.round(48 * Math.min(fontScale, 1.5)); + return - { banner.current = event.nativeEvent.layout.height; onChromeLayout(banner.current, strip.current); }} style={{ height: Math.min(height * 0.3, 104 * Math.min(fontScale, 1.5)), ...(landscape ? { position: "absolute", top: 0, left: 0, right: 320 } as const : {}), backgroundColor: colors.chrome, ...hairlines.bottom }} className="px-4 py-3"> - - - {waiting ? : } - {guiding && !transitMode && snapshot.distanceToManeuverMeters != null - ? {distance(snapshot.distanceToManeuverMeters)} - : {text.header}} + { banner.current = event.nativeEvent.layout.height; report(); }} + style={{ backgroundColor: colors.chrome, ...hairlines.bottom, ...(landscape ? { position: 'absolute', top: 0, left: 0, right: 320 } : {}) }} className="px-4 pb-2 pt-3"> + + + {showManeuver ? + : waiting ? + : } + + + {showManeuver ? <> + {/* Reserved even when the distance is withheld (paused), so the banner never changes height. */} + + {meters ? <>{meters.value} + {meters.unit} : null} + + {/* Two lines reserved: street (or the whole instruction), then the action. */} + + {lines.primary} + {lines.secondary ? {lines.secondary} : null} + + : <> + {text.header} + + {text.instruction} + + } - {text.instruction} - - - - - - {intent !== 'follow' && snapshot.location ? - - Ricentra - - : null} + {/* Reserved rows: "Poi …" and status never change the banner height. */} + + {then ? <> + Poi + + {maneuverLines(then, then.instruction).secondary ?? then.instruction} + : status ? {status} : null} + - { strip.current = event.nativeEvent.layout.height; onChromeLayout(banner.current, strip.current); }} style={[landscape ? { position: "absolute", right: 0, top: 0, bottom: 0, width: 320 } : { height: panelHeight }, hairlines.top]} className="rounded-t-3xl bg-surface"> - - {searching && text.signal ? {text.signal} - : {!transit && snapshot.distanceRemainingMeters != null ? `${remainingSeconds != null ? journeyDuration(remainingSeconds) + ' · ' : ''}${distance(snapshot.distanceRemainingMeters)}` : transit ? `Tratta ${transit.legIndex + 1} di ${transit.legCount}` : 'Il tuo viaggio'}} - setDetailsOpen(true)} className="min-h-12 min-w-12 items-center justify-center px-2">Dettagli + + + + { strip.current = event.nativeEvent.layout.height; report(); }} + style={[hairlines.top, landscape ? { position: 'absolute', right: 0, top: 0, bottom: 0, width: 320 } : null]} className="bg-surface px-3 pb-2 pt-2"> + {/* Above the strip, over the map: a problem or Ricentra never changes the strip height, so the + camera's anchor (and the puck) never jump when position quality changes. */} + + {intent !== 'follow' && snapshot.location ? + + Ricentra + + : null} + {problem || error || showRetry ? + {error ?? problem ?? text.quality} + {showRetry ? : null} + : null} + {!terminal && confirmation ? : null} - - {/* Only about two lines are visible above the actions: precision and warnings come first. */} - {text.precision ? {text.precision} : null} - {!searching && text.signal ? {text.signal} : null} - {text.transitWarning ? : null} - {text.quality} - {paused && snapshot.location && !transitMode ? Ultima posizione accettata: {time(snapshot.location.timestamp)} · ±{distance(snapshot.location.accuracyMeters)} : null} - {!terminal && snapshot.sessionId && !snapshot.notificationGranted ? { void Linking.openSettings(); }} /> : null} - {!terminal && snapshot.sessionId && snapshot.voice === 'unavailable' ? Solo indicazioni visive: nessuna voce italiana offline installata. : null} - {snapshot.problem === 'location-permission' ? : null} - {error ? : null} - {transit ? {transit.line ? `${transit.line} · ` : ''}{transit.timingStatus === 'prediction' ? 'Previsioni' : transit.timingStatus === 'scheduled' ? 'Da orario' : transit.timingStatus === 'cancelled' ? 'Corsa cancellata' : 'Orari non disponibili'} · consultato {time(transit.fetchedAt)}{transitAge >= 2 ? ` · consultato ${transitAge} min fa, da aggiornare` : ''} : null} - {snapshot.mode === 'transit' && (snapshot.problem === 'transit-replan-needed' || transitAge >= 2 || text.transitWarning) ? : null} - {snapshot.status === 'arrived' ? Guida terminata. Verifica l’ingresso sul posto. : null} - {snapshot.status === 'arrived' && snapshot.destinationDistanceMeters != null && snapshot.destinationDistanceMeters > 30 ? La destinazione dista ancora {distance(snapshot.destinationDistanceMeters)} in linea d’aria. : null} - - - - {!terminal && confirmation ? : } - - + + setDetailsOpen(true)}> + {arrival ? + {arrival} + + arrivo stimato + senza traffico + + : {remainingSeconds != null && paused ? 'Stima sospesa' : terminal ? text.header : 'Il tuo viaggio'}} + {!transit && snapshot.distanceRemainingMeters != null && !terminal + ? {remainingSeconds != null ? `${journeyDuration(remainingSeconds)} · ` : ''}{distance(snapshot.distanceRemainingMeters)} + : transit ? {`Tratta ${transit.legIndex + 1} di ${transit.legCount}`} : null} + + {!terminal && snapshot.sessionId ? : null} + {!terminal ? : null} + + setDetailsOpen(false)}> - + Dettagli navigazione setDetailsOpen(false)} /> - {transit ? - {transit.line ?? ((transit.phase === 'walk' || transit.phase === 'transfer') ? 'A piedi' : 'Mezzo pubblico')}{transit.headsign ? ` verso ${transit.headsign}` : ''} - {transit.from || transit.to ? {transit.from ?? 'Partenza'} → {transit.to ?? 'Destinazione'} : null} - {transit.timingStatus === 'scheduled' ? 'Orari programmati' : transit.timingStatus === 'prediction' ? 'Previsioni consultate' : transit.timingStatus === 'cancelled' ? 'Corsa cancellata' : 'Stato della corsa non disponibile'}{transit.departureAt ? ` · partenza ${time(transit.departureAt)}` : ''}{transit.arrivalAt ? ` · arrivo ${time(transit.arrivalAt)}` : ''}. Dati consultati {transitAge < 1 ? 'meno di un minuto fa' : `${transitAge} min fa`}. - {transitAge >= 2 ? : null} - {guiding && cues && snapshot.distanceToManeuverMeters != null ? Distanza dal punto da raggiungere in linea d’aria: {distance(snapshot.distanceToManeuverMeters)}. : null} - {transit.proximityAvailable === false ? : null} - {(transit.phase === 'walk' || transit.phase === 'transfer') ? Tratta a piedi senza indicazioni di svolta. : null} - {!terminal && !cues ? : null} - : null} + {text.precision ? {text.precision} : null} + {text.signal ? {text.signal} : null} + {text.transitWarning ? : null} + {transit ? {transit.line ? `${transit.line} · ` : ''}{transit.timingStatus === 'prediction' ? 'Previsioni' : transit.timingStatus === 'scheduled' ? 'Da orario' : transit.timingStatus === 'cancelled' ? 'Corsa cancellata' : 'Orari non disponibili'} · consultato {clock(transit.fetchedAt)}{transitAge >= 2 ? ` · ${transitAge} min fa, da aggiornare` : ''} : null} + {transitMode && (snapshot.problem === 'transit-replan-needed' || transitAge >= 2 || text.transitWarning) ? : null} {snapshot.nextInstruction ? Poi: {snapshot.nextInstruction} : null} - {snapshot.location ? Ultima posizione accettata: {time(snapshot.location.timestamp)} · ±{distance(snapshot.location.accuracyMeters)} : null} + {snapshot.location ? Ultima posizione accettata: {clock(snapshot.location.timestamp)} · ±{distance(snapshot.location.accuracyMeters)} : null} + {snapshot.status === 'arrived' ? Guida terminata. Verifica l’ingresso sul posto. : null} + {snapshot.status === 'arrived' && snapshot.destinationDistanceMeters != null && snapshot.destinationDistanceMeters > 30 ? La destinazione dista ancora {distance(snapshot.destinationDistanceMeters)} in linea d’aria. : null} + {!terminal && snapshot.sessionId && !snapshot.notificationGranted ? { void Linking.openSettings(); }} /> : null} + {snapshot.problem === 'location-permission' ? : null} {!terminal && snapshot.sessionId ? <> - {snapshot.voice === 'ready' ? 'Voce italiana disponibile sul dispositivo.' : snapshot.voice === 'muted' ? 'Voce disattivata.' : snapshot.voice === 'initializing' ? 'Preparazione della voce…' : 'Installa una voce italiana offline per la guida vocale.'} + {snapshot.voice === 'ready' ? 'Voce italiana disponibile sul dispositivo.' : snapshot.voice === 'muted' ? 'Voce disattivata.' : snapshot.voice === 'initializing' ? 'Preparazione della voce…' : 'Solo indicazioni visive: installa una voce italiana offline per la guida vocale.'} {(snapshot.voice === 'ready' || snapshot.voice === 'muted') ? : null} : null} - {source}. {snapshot.mode === 'transit' ? 'La posizione non conferma la presenza a bordo: conferma salita e discesa.' : 'Stime senza traffico in tempo reale.'} {snapshot.route ? `Percorso consultato alle ${time(snapshot.route.fetchedAt)}.` : ''} + {source}. {transitMode ? 'La posizione non conferma la presenza a bordo: conferma salita e discesa.' : 'Orario di arrivo stimato senza traffico in tempo reale.'} {snapshot.route ? `Percorso consultato alle ${clock(snapshot.route.fetchedAt)}.` : ''} La guida può continuare con lo schermo spento finché Android mantiene la sessione attiva. diff --git a/src/features/navigation/TransitFollowPanel.tsx b/src/features/navigation/TransitFollowPanel.tsx index bc6af3c..fefff05 100644 --- a/src/features/navigation/TransitFollowPanel.tsx +++ b/src/features/navigation/TransitFollowPanel.tsx @@ -1,3 +1,4 @@ +import { useRef } from 'react'; import { ActivityIndicator, Linking, ScrollView, useWindowDimensions, View } from 'react-native'; import type { TransitConfirmation } from '../../domain/navigation'; import { navigationLocationForReplan } from '../../domain/navigation'; @@ -21,8 +22,10 @@ export const FOLLOW_ACTIONS_HEIGHT = 80; * Following a transit journey: what to do now, the next boarding with its live provenance, and one * large confirmation beside Stop. Nothing here needs a position fix; GPS distance is advisory only. */ -export function TransitFollowPanel({ state, following, follow, onRecenter, onStop, onRetry, onConfirm, onReplan, onMute }: { +export function TransitFollowPanel({ state, following, follow, onRecenter, onStop, onRetry, onConfirm, onReplan, onMute, onChromeLayout }: { state: NavigationState; following: boolean; + /** Heights of the header and the sheet, so a walking camera anchors the puck between them. */ + onChromeLayout?: (top: number, bottom: number) => void; follow: { leg: RouteLeg | null; stop: Stop | null; board: ReturnType }; onRecenter: () => void; onStop: () => void; onRetry: () => void; onConfirm: (action: TransitConfirmation) => void; onReplan: () => void; /** Mutes or restores spoken announcements of the native session. */ @@ -30,6 +33,8 @@ export function TransitFollowPanel({ state, following, follow, onRecenter, onSto }) { const colors = useThemeColors(); const hairlines = useHairlines(); + const header = useRef(0); + const sheet = useRef(0); const { height, fontScale } = useWindowDimensions(); // Passed/missed times are re-evaluated at least every 15 s, as the native contract requires. const now = useNow(15_000); @@ -47,7 +52,7 @@ export function TransitFollowPanel({ state, following, follow, onRecenter, onSto ? liveBoarding({ leg: follow.leg, rows: follow.board.board?.rows ?? null, boardAvailable: !!follow.stop, loading: follow.board.arrivalsLoading || follow.board.schedules.phase === 'preparing', error: follow.board.arrivalsError, now }) : null; return - + { header.current = event.nativeEvent.layout.height; onChromeLayout?.(header.current, sheet.current); }} style={{ height: headerHeight, backgroundColor: colors.chrome, ...hairlines.bottom }} className="gap-1 px-4 py-3"> {starting ? : null} {model.title} @@ -61,7 +66,7 @@ export function TransitFollowPanel({ state, following, follow, onRecenter, onSto {voice.visible ? : null} - + { sheet.current = event.nativeEvent.layout.height; onChromeLayout?.(header.current, sheet.current); }} style={[{ height: Math.min(height * 0.56, Math.max(300, height - headerHeight - 160)) }, hairlines.top]} className="rounded-t-3xl bg-surface"> {model.warning ? : null} {error ? : null} diff --git a/src/features/navigation/guidance-camera.ts b/src/features/navigation/guidance-camera.ts index e7ddb00..51e2b34 100644 --- a/src/features/navigation/guidance-camera.ts +++ b/src/features/navigation/guidance-camera.ts @@ -47,12 +47,12 @@ export const CAMERA_PROFILES: Record = { bicycle: { pitch: 42, cruiseZoom: speed => lerp(18, 17.1, (speed - 3) / 5), minZoom: 16.6, anchor: 0.715, anticipationSeconds: 10, outgoingMeters: 45, courseSpeed: 1.6, holdSpeed: 0.8, typicalSpeed: 4.5, extrapolate: true, snapToRoute: true, - routeLookAhead: 25, bearingGain: 0.55, bearingDeadBand: 3, + routeLookAhead: 25, bearingGain: 0.62, bearingDeadBand: 3, }, car: { pitch: 48, cruiseZoom: speed => lerp(17.7, 15.7, (speed - 6) / 19), minZoom: 15.4, anchor: 0.735, anticipationSeconds: 12, outgoingMeters: 70, courseSpeed: 2.5, holdSpeed: 1.2, typicalSpeed: 9, extrapolate: true, snapToRoute: true, - routeLookAhead: 35, bearingGain: 0.6, bearingDeadBand: 2.5, + routeLookAhead: 35, bearingGain: 0.7, bearingDeadBand: 2.5, }, }; diff --git a/src/features/navigation/guidance-route.test.ts b/src/features/navigation/guidance-route.test.ts new file mode 100644 index 0000000..d78c9c2 --- /dev/null +++ b/src/features/navigation/guidance-route.test.ts @@ -0,0 +1,39 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { maneuverArrow, remainingGradient, traveledFraction } from './guidance-route'; +import { routeFixture } from './guidance-fixtures'; +import { angleDelta, bearingDegrees, distanceMeters } from './route-measure'; + +const fixture = routeFixture([{ bearing: 0, meters: 200 }, { bearing: 90, meters: 150, modifier: 'right' }, { bearing: 0, meters: 100, modifier: 'left' }]); + +test('travelled fraction uses the native progress on the same geometry, clamped', () => { + const at = (traveledMeters: number) => traveledFraction(fixture.route, { traveledMeters, routeLengthMeters: 450, segmentIndex: 0, stepIndex: 0 }); + assert.ok(Math.abs(at(225) - 0.5) < 0.002); + assert.equal(at(-3), 0); + assert.equal(at(9999), 1); + assert.equal(traveledFraction(null, undefined), 0); +}); + +test('the remaining gradient is transparent before the cut and the route colour after it', () => { + assert.deepEqual(remainingGradient('#000', 0), ['interpolate', ['linear'], ['line-progress'], 0, '#000', 1, '#000']); + const cut = remainingGradient('#000', 0.25); + assert.deepEqual(cut.slice(3), [0, 'rgba(0,0,0,0)', 0.25, 'rgba(0,0,0,0)', 0.250001, '#000', 1, '#000']); + const stops = cut.slice(3).filter((_, i) => i % 2 === 0) as number[]; + assert.ok(stops.every((stop, i) => i === 0 || stop > stops[i - 1]!), 'stops strictly increase'); +}); + +test('one arrow through the junction: real incoming and outgoing geometry, head along the exit', () => { + const turn = fixture.maneuvers[1]!; + for (const mode of ['walk', 'bicycle', 'car'] as const) { + const arrow = maneuverArrow(fixture.route, turn, mode, 100)!; + const corner = { latitude: turn.latitude!, longitude: turn.longitude! }; + assert.ok(arrow.shaft.some(([longitude, latitude]) => distanceMeters({ latitude, longitude }, corner) < 0.5), `${mode} passes the corner`); + assert.ok(Math.abs(angleDelta(arrow.head.bearing, 90)) < 1, `${mode} head points along the exit`); + } + // Close to the turn the shaft never extends behind the current position. + const near = maneuverArrow(fixture.route, turn, 'car', 195)!; + const [lon, lat] = near.shaft[0]!; + assert.ok(Math.abs(bearingDegrees({ latitude: lat, longitude: lon }, { latitude: turn.latitude!, longitude: turn.longitude! })) < 1, 'starts on the incoming leg'); + assert.ok(distanceMeters({ latitude: lat, longitude: lon }, { latitude: turn.latitude!, longitude: turn.longitude! }) < 5.5); + assert.equal(maneuverArrow(fixture.route, fixture.maneuvers[3], 'car', 440), null, 'no arrow for arrival'); +}); diff --git a/src/features/navigation/guidance-route.ts b/src/features/navigation/guidance-route.ts new file mode 100644 index 0000000..77996e4 --- /dev/null +++ b/src/features/navigation/guidance-route.ts @@ -0,0 +1,51 @@ +import type { GuidanceManeuver, RouteProgress } from '../../domain/navigation'; +import { framesManeuver, type CameraMode } from './guidance-camera'; +import { bearingDegrees, offsetOfIndex, sliceRoute, type RouteMeasure } from './route-measure'; + +/** + * Fraction of the rendered route already travelled. The native offset is measured with the same + * haversine metric on the same geometry; MapLibre's `line-progress` uses projected length, which + * differs by well under 0.1% across a city. + */ +export function traveledFraction(route: RouteMeasure | null, progress: RouteProgress | undefined): number { + if (!route || route.length <= 0 || !progress || !Number.isFinite(progress.traveledMeters)) return 0; + return Math.min(1, Math.max(0, progress.traveledMeters / route.length)); +} + +/** `line-gradient` hiding the travelled part of the active route (a muted full route shows beneath). */ +export function remainingGradient(color: string, fraction: number): unknown[] { + const cut = Math.min(0.999998, Math.max(0, fraction)); + if (cut <= 0) return ['interpolate', ['linear'], ['line-progress'], 0, color, 1, color]; + return ['interpolate', ['linear'], ['line-progress'], 0, 'rgba(0,0,0,0)', cut, 'rgba(0,0,0,0)', cut + 0.000001, color, 1, color]; +} + +const ARROW: Record = { + walk: { before: 12, after: 10 }, bicycle: { before: 20, after: 16 }, car: { before: 35, after: 26 }, +}; +export interface ManeuverArrow { + /** Shaft through the junction: incoming geometry, the maneuver point, outgoing geometry. */ + shaft: [number, number][]; + /** Arrowhead at the shaft end, rotated to the last outgoing segment. */ + head: { coordinate: [number, number]; bearing: number }; +} + +/** + * One cased arrow through the upcoming junction, from the real incoming/outgoing route geometry. + * Never drawn behind the current progress, for arrival/departure or a straight continuation. + */ +export function maneuverArrow(route: RouteMeasure | null, maneuver: GuidanceManeuver | undefined, mode: CameraMode, traveled: number): ManeuverArrow | null { + if (!route || !maneuver || !framesManeuver(maneuver)) return null; + const at = offsetOfIndex(route, maneuver.geometryIndex); + const { before, after } = ARROW[mode]; + const start = Math.max(traveled, at - before); + const end = Math.min(route.length, at + after); + if (end - start < 4 || end <= at) return null; + const points = sliceRoute(route, start, end); + if (points.length < 2) return null; + const last = points[points.length - 1]!; + const previous = sliceRoute(route, Math.max(at, end - 4), end)[0]!; + return { + shaft: points.map(point => [point.longitude, point.latitude]), + head: { coordinate: [last.longitude, last.latitude], bearing: bearingDegrees(previous, last) }, + }; +} diff --git a/src/features/navigation/maneuver-presentation.test.ts b/src/features/navigation/maneuver-presentation.test.ts new file mode 100644 index 0000000..87cd3a8 --- /dev/null +++ b/src/features/navigation/maneuver-presentation.test.ts @@ -0,0 +1,61 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import type { GuidanceManeuver, NavigationSnapshot } from '../../domain/navigation'; +import { idleNavigation } from '../../domain/navigation'; +import { bannerDistance, maneuverGlyph, maneuverLines, thenManeuver } from './maneuver-presentation'; + +const m = (type: string, more: Partial = {}): GuidanceManeuver => ({ id: '1:1', stepIndex: 1, geometryIndex: 3, type, instruction: 'x', ...more }); + +test('glyphs come from OSRM type and modifier; right turns mirror the left artwork', () => { + assert.deepEqual(maneuverGlyph(m('turn', { modifier: 'right' })), { name: 'left', mirror: true, label: 'Svolta a destra' }); + assert.deepEqual(maneuverGlyph(m('turn', { modifier: 'slight left' })), { name: 'slight-left', mirror: false, label: 'Svolta leggermente a sinistra' }); + assert.equal(maneuverGlyph(m('end of road', { modifier: 'sharp right' })).name, 'sharp-left'); + assert.equal(maneuverGlyph(m('new name', { modifier: 'straight' })).name, 'straight'); + assert.deepEqual(maneuverGlyph(m('continue', { modifier: 'uturn', drivingSide: 'right' })), { name: 'uturn-left', mirror: false, label: 'Inversione di marcia' }); + assert.equal(maneuverGlyph(m('continue', { modifier: 'uturn', drivingSide: 'left' })).mirror, true); + assert.equal(maneuverGlyph(m('fork', { modifier: 'slight right' })).name, 'fork-left'); + assert.equal(maneuverGlyph(m('merge', { modifier: 'slight left' })).name, 'merge-left'); + assert.equal(maneuverGlyph(m('off ramp', { modifier: 'right' })).mirror, true); + assert.deepEqual(maneuverGlyph(m('arrive', { modifier: 'right' })), { name: 'arrive-left', mirror: true, label: 'Destinazione a destra' }); + assert.equal(maneuverGlyph(m('arrive')).name, 'arrive'); +}); + +test('roundabouts show exit number and circulation; left-hand traffic mirrors', () => { + assert.deepEqual(maneuverGlyph(m('roundabout', { modifier: 'right', exit: 2, drivingSide: 'right' })), + { name: 'roundabout-right', mirror: false, exit: 2, label: 'Rotatoria, uscita 2' }); + assert.equal(maneuverGlyph(m('rotary', { modifier: 'left', exit: 4 })).name, 'roundabout-left'); + assert.equal(maneuverGlyph(m('roundabout', { modifier: 'straight', exit: 3 })).name, 'roundabout-straight'); + const clockwise = maneuverGlyph(m('roundabout', { modifier: 'right', exit: 1, drivingSide: 'left' })); + assert.deepEqual([clockwise.name, clockwise.mirror], ['roundabout-left', true], 'mirrored left exit = clockwise right exit'); +}); + +test('unknown types or missing modifiers never become guessed turns', () => { + for (const maneuver of [m('future maneuver', { modifier: 'left' }), m('turn'), m('fork'), m('roundabout', { exit: 2 }), undefined]) { + assert.equal(maneuverGlyph(maneuver).name, 'unknown'); + } + assert.equal(maneuverGlyph(m('roundabout', { exit: 2 })).exit, 2, 'the supplied exit number is still shown'); +}); + +test('banner distance: coarse steps, subordinate unit, Italian decimal comma', () => { + assert.deepEqual(bannerDistance(42), { value: '40', unit: 'm', label: '40 metri' }); + assert.deepEqual(bannerDistance(2), { value: '0', unit: 'm', label: '0 metri' }); + assert.deepEqual(bannerDistance(347), { value: '350', unit: 'm', label: '350 metri' }); + assert.deepEqual(bannerDistance(998), { value: '1', unit: 'km', label: '1 chilometro' }); + assert.deepEqual(bannerDistance(1260), { value: '1,3', unit: 'km', label: '1,3 chilometri' }); + assert.deepEqual(bannerDistance(2000), { value: '2', unit: 'km', label: '2 chilometri' }); + assert.equal(bannerDistance(Number.NaN).value, '–'); +}); + +test('street and action lines split only the supplied street suffix', () => { + assert.deepEqual(maneuverLines(m('turn', { name: 'Via Roma', instruction: 'Svolta a destra su Via Roma' }), undefined), { primary: 'Via Roma', secondary: 'Svolta a destra' }); + assert.deepEqual(maneuverLines(m('turn', { instruction: 'Svolta a destra' }), undefined), { primary: 'Svolta a destra', secondary: null }); + assert.deepEqual(maneuverLines(undefined, 'Stai arrivando a destinazione'), { primary: 'Stai arrivando a destinazione', secondary: null }); +}); + +test('"Poi" uses the gap between maneuvers, not proximity', () => { + const base: NavigationSnapshot = { ...idleNavigation, status: 'navigating', mode: 'car', upcomingManeuver: m('turn', { modifier: 'right' }) }; + const following = { ...m('turn', { id: '1:2', modifier: 'left' }), afterUpcomingMeters: 40, afterUpcomingSeconds: 6 }; + assert.equal(thenManeuver({ ...base, followingManeuver: following })?.id, '1:2'); + assert.equal(thenManeuver({ ...base, followingManeuver: { ...following, afterUpcomingMeters: 600, afterUpcomingSeconds: 45 } }), null); + assert.equal(thenManeuver({ ...base, distanceToManeuverMeters: 5, followingManeuver: { ...following, afterUpcomingMeters: 600, afterUpcomingSeconds: 45 } }), null, 'being close to the first turn is irrelevant'); +}); diff --git a/src/features/navigation/maneuver-presentation.ts b/src/features/navigation/maneuver-presentation.ts new file mode 100644 index 0000000..7b7b057 --- /dev/null +++ b/src/features/navigation/maneuver-presentation.ts @@ -0,0 +1,102 @@ +import type { GuidanceManeuver, ManeuverModifier, NavigationSnapshot } from '../../domain/navigation'; +import { CAMERA_PROFILES, followsClosely, type CameraMode } from './guidance-camera'; + +/** Glyph names rendered by scripts/render-navigation-assets.mjs (drawn for left turns, right-hand traffic). */ +export type GlyphName = 'straight' | 'slight-left' | 'left' | 'sharp-left' | 'uturn-left' | 'fork-left' | 'merge-left' | 'ramp-left' + | 'roundabout-right' | 'roundabout-slight-right' | 'roundabout-straight' | 'roundabout-slight-left' | 'roundabout-left' + | 'roundabout-sharp-left' | 'roundabout-uturn' | 'arrive' | 'arrive-left' | 'unknown'; +export interface ManeuverGlyph { + name: GlyphName; + /** Mirror horizontally: right turns, or clockwise circulation in left-hand traffic. */ + mirror: boolean; + /** Roundabout exit number shown beside the glyph. */ + exit?: number; + /** Spoken description of the glyph for TalkBack. */ + label: string; +} + +const side = (modifier: ManeuverModifier | undefined): 'left' | 'right' | null => + modifier === 'left' || modifier === 'slight left' || modifier === 'sharp left' ? 'left' + : modifier === 'right' || modifier === 'slight right' || modifier === 'sharp right' ? 'right' : null; +const flip = (modifier: ManeuverModifier): ManeuverModifier => modifier.includes('left') + ? modifier.replace('left', 'right') as ManeuverModifier : modifier.includes('right') ? modifier.replace('right', 'left') as ManeuverModifier : modifier; + +const TURN_TYPES = new Set(['turn', 'continue', 'end of road', 'new name', 'notification', 'use lane', 'exit roundabout', 'exit rotary', 'depart']); +const ROUNDABOUT_TYPES = new Set(['roundabout', 'rotary', 'roundabout turn']); +const unknownGlyph: ManeuverGlyph = { name: 'unknown', mirror: false, label: 'Manovra' }; + +/** + * The banner glyph from raw OSRM facts. A missing or unfamiliar type or modifier gives the neutral + * glyph with the supplied text; a turn direction is never guessed. + */ +export function maneuverGlyph(maneuver: GuidanceManeuver | undefined): ManeuverGlyph { + if (!maneuver) return unknownGlyph; + const { type, modifier } = maneuver; + const leftHand = maneuver.drivingSide === 'left'; + if (type === 'arrive') { + const where = side(modifier); + return where ? { name: 'arrive-left', mirror: where === 'right', label: `Destinazione a ${where === 'left' ? 'sinistra' : 'destra'}` } + : { name: 'arrive', mirror: false, label: 'Destinazione' }; + } + if (ROUNDABOUT_TYPES.has(type)) { + if (!modifier) return { ...unknownGlyph, ...(maneuver.exit ? { exit: maneuver.exit } : {}), label: 'Rotatoria' }; + // Left-hand traffic circulates clockwise: the mirrored glyph of the mirrored exit direction. + const seen = leftHand ? flip(modifier) : modifier; + const name: GlyphName = seen === 'uturn' ? 'roundabout-uturn' : seen === 'straight' ? 'roundabout-straight' + : (`roundabout-${seen.replace(' ', '-')}` as GlyphName); + const known: GlyphName[] = ['roundabout-right', 'roundabout-slight-right', 'roundabout-straight', 'roundabout-slight-left', 'roundabout-left', 'roundabout-sharp-left', 'roundabout-uturn']; + const resolved = known.includes(name) ? name : seen === 'sharp right' ? 'roundabout-right' : 'roundabout-straight'; + return { name: resolved, mirror: leftHand, ...(maneuver.exit ? { exit: maneuver.exit } : {}), label: `Rotatoria${maneuver.exit ? `, uscita ${maneuver.exit}` : ''}` }; + } + const where = side(modifier); + const mirror = where === 'right'; + if (type === 'fork') return where ? { name: 'fork-left', mirror, label: `Bivio, tieni la ${where === 'left' ? 'sinistra' : 'destra'}` } : unknownGlyph; + if (type === 'merge') return where ? { name: 'merge-left', mirror, label: `Immettiti a ${where === 'left' ? 'sinistra' : 'destra'}` } : { name: 'straight', mirror: false, label: 'Immettiti' }; + if (type === 'on ramp' || type === 'off ramp') return where ? { name: 'ramp-left', mirror, label: `Rampa a ${where === 'left' ? 'sinistra' : 'destra'}` } : unknownGlyph; + if (!TURN_TYPES.has(type) || !modifier) return unknownGlyph; + if (modifier === 'straight') return { name: 'straight', mirror: false, label: 'Dritto' }; + if (modifier === 'uturn') return { name: 'uturn-left', mirror: leftHand, label: 'Inversione di marcia' }; + const degree = modifier.startsWith('slight') ? 'slight-left' : modifier.startsWith('sharp') ? 'sharp-left' : 'left'; + const words = { 'slight-left': 'leggermente ', 'sharp-left': 'nettamente ', left: '' }[degree]; + return { name: degree, mirror, label: `Svolta ${words}a ${where === 'left' ? 'sinistra' : 'destra'}` }; +} + +/** + * Banner distance: a number and a subordinate unit. Steps of 5 m below 100 m, 10 m below 1 km, + * then tenths of a kilometre; never more precise than guidance can be. + */ +export function bannerDistance(meters: number): { value: string; unit: string; label: string } { + if (!Number.isFinite(meters) || meters < 0) return { value: '–', unit: '', label: '' }; + if (meters < 1000) { + const step = meters < 100 ? 5 : 10; + const value = Math.max(0, Math.round(meters / step) * step); + if (value >= 1000) return { value: '1', unit: 'km', label: '1 chilometro' }; + return { value: String(value), unit: 'm', label: `${value} metri` }; + } + const km = (Math.round(meters / 100) / 10).toFixed(1).replace('.', ',').replace(/,0$/, ''); + return { value: km, unit: 'km', label: `${km} chilometri` }; +} + +/** + * Street (primary) and action (secondary) lines. The street is the supplied OSRM name; the action is + * the native Italian instruction with that name's " su " suffix removed, never re-derived. + */ +export function maneuverLines(maneuver: GuidanceManeuver | undefined, instruction: string | undefined): { primary: string; secondary: string | null } { + const text = maneuver?.instruction ?? instruction ?? ''; + const name = maneuver?.name ?? (maneuver?.ref ?? undefined); + if (name) { + const suffix = ` su ${name}`; + const action = text.endsWith(suffix) ? text.slice(0, -suffix.length) : text; + return { primary: name, secondary: action && action !== name ? action : null }; + } + return { primary: text, secondary: null }; +} + +/** "Poi …" only when the following maneuver comes within about ten seconds of travel. */ +export function thenManeuver(snapshot: NavigationSnapshot): GuidanceManeuver | null { + const mode = snapshot.mode === 'walk' || snapshot.mode === 'bicycle' || snapshot.mode === 'car' ? snapshot.mode as CameraMode : null; + const following = snapshot.followingManeuver; + if (!mode || !following || !snapshot.upcomingManeuver) return null; + const speed = Math.max(CAMERA_PROFILES[mode].typicalSpeed, snapshot.location?.speedMps ?? 0); + return followsClosely(following, speed) ? following : null; +} diff --git a/src/features/navigation/useGuidanceCamera.ts b/src/features/navigation/useGuidanceCamera.ts index be0ffc0..bfaa92f 100644 --- a/src/features/navigation/useGuidanceCamera.ts +++ b/src/features/navigation/useGuidanceCamera.ts @@ -1,16 +1,27 @@ import { useMemo, useRef } from 'react'; import type { NavigationSnapshot } from '../../domain/navigation'; +import type { Coordinate, RoutePlan } from '../../domain/types'; import type { MapCamera } from '../map/useMapCamera'; -import { GuidanceCamera, overviewBounds, type CameraFrame, type CameraIntent, type CameraMode, type GuidanceViewport } from './guidance-camera'; +import { GuidanceCamera, overviewBounds, type CameraFrame, type CameraIntent, type CameraMode, type GuidanceViewport, type PuckKind } from './guidance-camera'; +import { maneuverArrow, traveledFraction, type ManeuverArrow } from './guidance-route'; import type { Padding } from './map-projection'; -import { measureRoute } from './route-measure'; +import { measureRoute, type RouteMeasure } from './route-measure'; +import { sessionPlan } from './transit-follow'; -export interface GuidanceOverview { key: number; bounds: [number, number, number, number]; padding: Padding } -/** What the map needs during guidance: the camera intent, the follow frame and an overview frame. */ +export interface GuidanceFit { key: string; bounds: [number, number, number, number]; padding: Padding } +/** What the map needs during guidance: camera intent and frames, the puck and the route styling. */ export interface GuidanceMapState { intent: CameraIntent; + /** Road and transit walking modes; null while the camera only frames (transit without a fix). */ + mode: CameraMode | null; frame: CameraFrame | null; - overview: GuidanceOverview | null; + /** Overview of the remaining route, framed once per explicit request. */ + overview: GuidanceFit | null; + /** Transit without a usable fix: the current leg and its stop, framed once per leg. */ + fit: GuidanceFit | null; + puck: { coordinate: Coordinate; heading: number | null; kind: PuckKind } | null; + /** Road route styling: travelled fraction and the arrow through the next junction. */ + route: { fraction: number; arrow: ManeuverArrow | null } | null; /** Called at gesture start: enters free immediately, before the region settles. */ onUserGesture(): void; } @@ -18,45 +29,85 @@ export interface GuidanceMapState { const ROAD_MODES = new Set(['walk', 'bicycle', 'car']); /** Location states in which the accepted fix is current; anything else holds the camera. */ const LIVE_STATUSES = new Set(['navigating', 'off-route', 'rerouting', 'routing']); +const FIX_FRESH_MS = 15_000; + +function boundsOf(points: Coordinate[], pad = 0.0004): [number, number, number, number] | null { + if (!points.length) return null; + let [west, south, east, north] = [Infinity, Infinity, -Infinity, -Infinity]; + for (const point of points) { + west = Math.min(west, point.longitude); east = Math.max(east, point.longitude); + south = Math.min(south, point.latitude); north = Math.max(north, point.latitude); + } + return [west - pad, south - pad, east + pad, north + pad]; +} /** * First-person guidance camera, driven only by accepted native navigation state (no second * location stream, no MapLibre auto-tracking). One planner per session; one frame per distinct fix. + * Transit access, transfer and final walks use the walking camera on the supplied trace when a + * usable fix exists (still without turn instructions); otherwise the current leg and stop are framed. */ -export function useGuidanceCamera({ snapshot, camera, viewport, active }: { - snapshot: NavigationSnapshot; camera: MapCamera; viewport: GuidanceViewport; active: boolean; +export function useGuidanceCamera({ snapshot, camera, viewport, active, transitPlan }: { + snapshot: NavigationSnapshot; camera: MapCamera; viewport: GuidanceViewport; active: boolean; transitPlan?: RoutePlan | null; }): GuidanceMapState | null { const planner = useRef<{ session: string | null; camera: GuidanceCamera; recenter: number } | null>(null); - const mode = snapshot.mode && ROAD_MODES.has(snapshot.mode) ? snapshot.mode as CameraMode : null; if (!planner.current || planner.current.session !== snapshot.sessionId) { planner.current = { session: snapshot.sessionId, camera: new GuidanceCamera(), recenter: camera.guidanceRecenter }; } - const geometry = snapshot.route?.geometry; - const route = useMemo(() => geometry && geometry.length > 1 ? measureRoute(geometry) : null, [geometry]); - const usable = snapshot.locationUsable === true && LIVE_STATUSES.has(snapshot.status); + const transit = snapshot.mode === 'transit' ? snapshot.transit : undefined; + const plan = transit ? sessionPlan(snapshot, transitPlan ?? null) : null; + const legIndices = transit ? (transit.sourceLegIndices?.length ? transit.sourceLegIndices : [transit.legIndex]) : null; + const legKey = legIndices?.join(',') ?? ''; + const legGeometry = useMemo(() => plan && legIndices ? legIndices.flatMap(index => plan.legs[index]?.geometry ?? []) : null, + // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed by the leg indices + [plan, legKey]); + const walkingLeg = transit && (transit.phase === 'walk' || transit.phase === 'transfer'); + const geometry = transit ? (walkingLeg ? legGeometry : null) : snapshot.route?.geometry; + const route = useMemo(() => geometry && geometry.length > 1 ? measureRoute(geometry) : null, [geometry]); + const location = snapshot.location; + const fresh = location !== undefined && Date.now() - location.timestamp <= FIX_FRESH_MS; + const usable = snapshot.locationUsable === true && LIVE_STATUSES.has(snapshot.status) && (!transit || fresh); + const mode: CameraMode | null = snapshot.mode && ROAD_MODES.has(snapshot.mode) ? snapshot.mode as CameraMode + : walkingLeg && usable ? 'walk' : null; const state = planner.current; let frame: CameraFrame | null = null; - if (active && mode && snapshot.location) { - frame = state.camera.update({ - mode, fix: snapshot.location, usable, route, routeRevision: snapshot.routeRevision, + if (active && mode && location) { + frame = state.camera.update(transit ? { mode, fix: location, usable, route, viewport, traceOnly: true } : { + mode, fix: location, usable, route, routeRevision: snapshot.routeRevision, progress: snapshot.routeProgress, alignment: snapshot.alignment, snapped: snapshot.snappedLocation, upcoming: snapshot.upcomingManeuver, following: snapshot.followingManeuver, distanceToManeuverMeters: snapshot.distanceToManeuverMeters, viewport, }); if (camera.guidanceRecenter !== state.recenter) { state.recenter = camera.guidanceRecenter; frame = state.camera.recenter() ?? frame; } } + const padding = useMemo(() => ({ top: viewport.top + 24, right: 32, bottom: viewport.height - viewport.bottom + 24, left: 32 }), [viewport]); const overviewKey = camera.guidanceOverview; const traveled = snapshot.routeProgress?.traveledMeters ?? 0; - const location = snapshot.location; // Framed once per explicit request: later progress or a reroute never refits it. - const overview = useMemo(() => { - if (!route || overviewKey === 0) return null; - const bounds = overviewBounds(route, traveled, location ? { latitude: location.latitude, longitude: location.longitude } : undefined); - if (!bounds) return null; - return { key: overviewKey, bounds, padding: { top: viewport.top + 24, right: 32, bottom: viewport.height - viewport.bottom + 24, left: 32 } }; + const planRoute = useMemo(() => plan?.geometry.length ? measureRoute(plan.geometry) : null, [plan]); + const overviewRoute = transit ? planRoute : route; + const overview = useMemo(() => { + if (!overviewRoute || overviewKey === 0) return null; + const bounds = overviewBounds(overviewRoute, transit ? 0 : traveled, location ? { latitude: location.latitude, longitude: location.longitude } : undefined); + return bounds ? { key: `overview:${overviewKey}`, bounds, padding } : null; // eslint-disable-next-line react-hooks/exhaustive-deps -- deliberately frozen until the next request - }, [overviewKey, route]); + }, [overviewKey, overviewRoute !== null]); + const fit = useMemo(() => { + if (!transit || mode || !legGeometry?.length) return null; + const bounds = boundsOf(legGeometry); + return bounds ? { key: `leg:${snapshot.sessionId}:${legKey}`, bounds, padding } : null; + // eslint-disable-next-line react-hooks/exhaustive-deps -- one frame per leg + }, [transit !== undefined, mode, legKey, legGeometry !== null]); + const fraction = traveledFraction(route, snapshot.routeProgress); + const upcoming = snapshot.upcomingManeuver; + const arrow = useMemo(() => !transit && mode ? maneuverArrow(route, upcoming, mode, traveled) : null, + // eslint-disable-next-line react-hooks/exhaustive-deps -- the arrow follows the maneuver id and coarse progress + [route, upcoming?.id, mode, transit !== undefined, Math.round(traveled / 2)]); const { stopFollowing } = camera; - if (!active || !mode) return null; - return { intent: camera.guidanceIntent, frame, overview, onUserGesture: stopFollowing }; + if (!active || (!mode && !transit)) return null; + const puck = frame?.puck ?? (location ? { coordinate: { latitude: location.latitude, longitude: location.longitude }, heading: null, kind: (usable ? 'dot' : 'retained') as PuckKind } : null); + return { + intent: camera.guidanceIntent, mode, frame, overview, fit, puck, + route: !transit && route ? { fraction, arrow } : null, onUserGesture: stopFollowing, + }; } diff --git a/src/theme/brand-assets.test.ts b/src/theme/brand-assets.test.ts index ba5a727..2cd69d9 100644 --- a/src/theme/brand-assets.test.ts +++ b/src/theme/brand-assets.test.ts @@ -39,3 +39,9 @@ test('icon, adaptive, themed, splash and favicon PNGs match a fresh render of as const result = spawnSync(process.execPath.endsWith('bun') ? 'node' : process.execPath, ['scripts/render-brand-assets.mjs', '--check'], { cwd: fileURLToPath(root), encoding: 'utf8' }); assert.equal(result.status, 0, result.stderr || result.stdout); }); + +test('navigation puck, maneuver glyph and map symbol PNGs match a fresh render', async () => { + const { spawnSync } = await import('node:child_process'); + const result = spawnSync(process.execPath.endsWith('bun') ? 'node' : process.execPath, ['scripts/render-navigation-assets.mjs', '--check'], { cwd: fileURLToPath(root), encoding: 'utf8' }); + assert.equal(result.status, 0, result.stderr || result.stdout); +}); diff --git a/src/theme/brand-basemap.ts b/src/theme/brand-basemap.ts index fe63e41..10a7959 100644 --- a/src/theme/brand-basemap.ts +++ b/src/theme/brand-basemap.ts @@ -246,6 +246,18 @@ export function brandRecipe(scheme: ColorScheme): StyleRecipe { ], keep: [], insert: [ + { + // Driving guidance shows one-way chevrons (app image `oneway-`); hidden otherwise. + before: 'highway-name-path', + layer: { + id: 'avoid_oneway', type: 'symbol', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 15, + filter: ['all', ['==', ['get', 'oneway'], 1], ['match', ['get', 'class'], ['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'minor', 'service'], true, false]], + layout: { + visibility: 'none', 'symbol-placement': 'line', 'symbol-spacing': 90, 'icon-image': `oneway-${scheme}`, 'icon-rotate': 90, + 'icon-rotation-alignment': 'map', 'icon-allow-overlap': true, 'icon-ignore-placement': true, + }, + }, + }, { before: 'poi_r20', layer: dot([1, 7], 15) }, { before: 'poi_r20', layer: dot([7, 20], 16) }, { before: 'poi_r20', layer: dot([20], 17) }, diff --git a/src/theme/map-style.test.ts b/src/theme/map-style.test.ts index 0f4efc6..ab98957 100644 --- a/src/theme/map-style.test.ts +++ b/src/theme/map-style.test.ts @@ -50,6 +50,8 @@ for (const scheme of schemes) { walk(layer.paint, layer.id); walk(layer.layout, layer.id); for (const property of ['icon-image', 'fill-pattern', 'line-pattern']) { + // The one exception is the app's own greyscale one-way chevron (assets/navigation, not the sprite). + if (layer.id === 'avoid_oneway' && property === 'icon-image') { assert.equal(layer.layout?.[property], `oneway-${scheme}`); continue; } assert.ok(!(property in (layer.layout ?? {})) && !(property in (layer.paint ?? {})), `${layer.id} uses sprite ${property}`); } } @@ -124,7 +126,7 @@ for (const scheme of schemes) { test(`avoid-${scheme}: labels meet AA on their halos and on the surfaces beneath them`, () => { const style = mapStyleFor(scheme); const ink = basemapInks[scheme]; - const labels = (style.layers as StyleLayer[]).filter(layer => layer.type === 'symbol'); + const labels = (style.layers as StyleLayer[]).filter(layer => layer.type === 'symbol' && layer.layout?.['text-field'] !== undefined); for (const layer of labels) { const color = String(layer.paint?.['text-color']); const halo = String(layer.paint?.['text-halo-color']); diff --git a/src/theme/palette.ts b/src/theme/palette.ts index d06d57a..5e51b7d 100644 --- a/src/theme/palette.ts +++ b/src/theme/palette.ts @@ -51,6 +51,8 @@ export interface MapColors { background: string; routeLine: string; routeCasing: string; + /** The part of a guidance route already travelled: thinner and muted beneath the active line. */ + routeTraveled: string; placeMarker: string; stopMarker: string; markerStroke: string; @@ -132,6 +134,7 @@ export const palettes: Record = { background: basemapInks.light.land, routeLine: '#09090B', routeCasing: '#FFFFFF', + routeTraveled: '#A1A1AA', placeMarker: '#09090B', stopMarker: '#71717A', markerStroke: '#FFFFFF', @@ -152,6 +155,7 @@ export const palettes: Record = { background: basemapInks.dark.land, routeLine: '#FFFFFF', routeCasing: '#000000', + routeTraveled: '#52525B', placeMarker: '#FFFFFF', stopMarker: '#A1A1AA', markerStroke: '#000000', From df43e5e5ad1cf981fb5cd5467f4f605700938baa Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli <27171200+fcastrovilli@users.noreply.github.com> Date: Mon, 2 Nov 2026 10:32:42 +0100 Subject: [PATCH 4/5] Keep guidance overlays tappable and record emulator evidence Ricentra, the problem row and transit confirmations float above the strip from the screen container: Android delivers no touches to views drawn outside their parent's bounds. Record the emulator replay evidence for first-person guidance in the delivery notes. --- docs/development/delivery.md | 4 +++ src/features/navigation/NavigationPanel.tsx | 34 +++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/docs/development/delivery.md b/docs/development/delivery.md index 8df1a91..953be2d 100644 --- a/docs/development/delivery.md +++ b/docs/development/delivery.md @@ -6,6 +6,10 @@ Version **0.2.0-beta.1 / Android code 12** is a GitHub **pre-release** for a phy Emulator evidence (Android 16 AOSP, no Google services) covers launch, theme switching, sheets, search, stop boards, road navigation start at 30–45 m accuracy, replayed walking with reroute, transit following by confirmations with device location off, the date/time dialogs and the Organic Maps hand-off. Physical GPS, screen-off guidance, real boarding/transfers, audible voice and battery remain field-test checks; the release notes carry the checklist. +## Unreleased: first-person guidance + +Development-client evidence on the Android 16 AOSP emulator (no Google services, software ANGLE rendering) with 1 Hz test-provider replays of FOSSGIS walking, cycling and driving routes in Turin: the puck stays on its anchor (median error 0.08–0.19% of the screen height, p95 ≤ 0.66% during steady segments), the planner's projection matches MapLibre's own `project()` within about 1–2 px median, turn framing begins within one fix of the 8/10/12 s window, a 30 s stop holds bearing and zoom, a pan enters free at gesture start (about 60–75 ms to the free intent) and reroutes leave a free camera untouched, Ricentra issues one 500 ms move, degraded fixes stop the lead and keep the labelled last instruction, a live light/dark switch keeps the route, puck and basemap adjustments, and a transit access walk uses the walking camera. Emulator frame times (median 57 ms under screen recording) qualify the emulator only; physical-device smoothness, GPS course and speed quality, screen-off guidance and battery use remain field checks. + ## Current release line: 0.1.9 Version **0.1.9 / Android code 11** combines compact map-first UI, stable task/navigation geometry, foreground location acquisition and read-only provider diagnostics. Navigation still uses its existing GPS source and 20 m / 10 s acceptance policy. The production launcher exclusion keeps Google barcode-scanner dependencies out of the runtime graph while the separate development client remains available. diff --git a/src/features/navigation/NavigationPanel.tsx b/src/features/navigation/NavigationPanel.tsx index 87d1109..1e26042 100644 --- a/src/features/navigation/NavigationPanel.tsx +++ b/src/features/navigation/NavigationPanel.tsx @@ -34,6 +34,7 @@ export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onO const [now, setNow] = useState(Date.now()); const banner = useRef(0); const strip = useRef(0); + const [stripHeight, setStripHeight] = useState(0); const transitMode = snapshot.mode === 'transit'; const waiting = busy === 'start' || snapshot.status === 'waiting-for-fix' || snapshot.status === 'routing' || snapshot.status === 'rerouting'; const remainingSeconds = !transitMode ? snapshot.durationRemainingSeconds : undefined; @@ -114,23 +115,8 @@ export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onO - { strip.current = event.nativeEvent.layout.height; report(); }} + { strip.current = event.nativeEvent.layout.height; setStripHeight(strip.current); report(); }} style={[hairlines.top, landscape ? { position: 'absolute', right: 0, top: 0, bottom: 0, width: 320 } : null]} className="bg-surface px-3 pb-2 pt-2"> - {/* Above the strip, over the map: a problem or Ricentra never changes the strip height, so the - camera's anchor (and the puck) never jump when position quality changes. */} - - {intent !== 'follow' && snapshot.location ? - - Ricentra - - : null} - {problem || error || showRetry ? - {error ?? problem ?? text.quality} - {showRetry ? : null} - : null} - {!terminal && confirmation ? : null} - + {/* Above the strip, over the map: a problem or Ricentra never changes the strip height, so the + camera's anchor (and the puck) never jump. It lives in the screen container: Android delivers + no touches to children drawn outside their parent's bounds. */} + + {intent !== 'follow' && snapshot.location ? + + Ricentra + + : null} + {problem || error || showRetry ? + {error ?? problem ?? text.quality} + {showRetry ? : null} + : null} + {!terminal && confirmation ? : null} + setDetailsOpen(false)}> From 973e4d9fa7b02c4febe68d6bdede5d365607fc33 Mon Sep 17 00:00:00 2001 From: Francesco Castrovilli <27171200+fcastrovilli@users.noreply.github.com> Date: Mon, 2 Nov 2026 11:23:25 +0100 Subject: [PATCH 5/5] Address review findings on first-person guidance - Derive motion honestly when the platform omits speed/course: a displacement must clear the combined horizontal accuracy (min 3 m, 10 s window), motion needs two consistent estimates, course accuracy is geometric; stationary jitter yields no speed, course or lead. - Show status in its own pill below the banner so 'Poi' never hides a reduced-precision or pause warning; both are in the spoken label. - Transit ride/wait: Ricentra re-fits the current leg (the recenter request is part of the fit identity); one pure command decision. - Keep the north-up/flat reset after guidance until a browse command that is actually issued carries it; a user gesture cancels it. - Model the visible map as a rectangle with horizontal insets (landscape side panel) for anchoring, projection and fits. - Fixed banner row heights measured per font scale (text capped at 2x); one street line when an action line is shown. - Stack the bottom strip on narrow screens or large text. - Lay the roundabout exit number beside its glyph, sized in proportion. - '1 chilometro' for 1000-1049 m. - One-way chevrons also on reverse one-way roads (oneway = -1). --- docs/development/navigation.md | 4 +- docs/development/ux.md | 4 +- src/features/app/AppShell.tsx | 12 +- src/features/map/MapCanvas.native.tsx | 20 +-- src/features/map/orientation-reset.test.ts | 21 +++ src/features/map/orientation-reset.ts | 21 +++ src/features/map/useGuidanceCameraDriver.ts | 49 +++---- .../navigation/BannerReserveProbe.tsx | 40 ++++++ .../navigation/ManeuverGlyphImage.tsx | 8 +- src/features/navigation/NavigationPanel.tsx | 128 +++++++++++------- src/features/navigation/exit-number.ts | 6 + .../navigation/guidance-camera.test.ts | 32 ++++- src/features/navigation/guidance-camera.ts | 55 ++++---- .../navigation/guidance-commands.test.ts | 35 +++++ src/features/navigation/guidance-commands.ts | 28 ++++ src/features/navigation/guidance-fixtures.ts | 4 +- .../navigation/guidance-layout.test.ts | 22 +++ src/features/navigation/guidance-layout.ts | 39 ++++++ .../navigation/maneuver-presentation.test.ts | 8 ++ .../navigation/maneuver-presentation.ts | 2 +- src/features/navigation/map-projection.ts | 13 +- .../navigation/motion-estimator.test.ts | 49 +++++++ src/features/navigation/motion-estimator.ts | 69 ++++++++++ src/features/navigation/useGuidanceCamera.ts | 14 +- src/theme/brand-basemap.ts | 5 +- src/theme/map-style.test.ts | 17 +++ 26 files changed, 564 insertions(+), 141 deletions(-) create mode 100644 src/features/map/orientation-reset.test.ts create mode 100644 src/features/map/orientation-reset.ts create mode 100644 src/features/navigation/BannerReserveProbe.tsx create mode 100644 src/features/navigation/exit-number.ts create mode 100644 src/features/navigation/guidance-commands.test.ts create mode 100644 src/features/navigation/guidance-commands.ts create mode 100644 src/features/navigation/guidance-layout.test.ts create mode 100644 src/features/navigation/guidance-layout.ts create mode 100644 src/features/navigation/motion-estimator.test.ts create mode 100644 src/features/navigation/motion-estimator.ts diff --git a/docs/development/navigation.md b/docs/development/navigation.md index 6838652..b8de3aa 100644 --- a/docs/development/navigation.md +++ b/docs/development/navigation.md @@ -31,9 +31,9 @@ Road guidance uses an app-controlled MapLibre camera fed only by accepted native - `routeProgress.traveledMeters` is the snapped position measured with the native haversine on the bridged route geometry, so the interface can split travelled and remaining route on exactly what it draws. `snappedLocation` and `alignment` (`aligned`, `deviating`, `unknown` when the fix was too coarse to judge deviation) tell the camera whether the snapped position is credible. - `location` adds speed, course and their accuracies when the platform supplies finite values, plus the monotonic `elapsedMs` sample time used for fix intervals and duplicate detection. -The camera planner (`src/features/navigation/guidance-camera.ts`) produces one frame per distinct fix. The map eases linearly to it over the measured fix interval, so the puck (drawn at the camera anchor while following) and the map move on one clock with React rendering at 1 Hz. It is course-up with circular filtering (the short way across north) and holds its bearing when slow; pitch, zoom and the puck anchor are per mode (walking 34°, zoom 18.3, 67% of the map left between banner and strip; cycling 42°, 17.1–18, 71.5%; driving 48°, 15.7–17.7 by smoothed speed, 73.5%). The anchor is placed with top padding: MapLibre centres the padded rectangle, so bottom padding alone would raise the puck. Turn framing starts 8/10/12 s before the maneuver (walking/cycling/driving), keeps the junction and a short outgoing path (and a second turn that follows within about ten seconds) inside the visible map, and releases over 2–3 s. Cycling and driving draw at the route-snapped position only while `alignment` is `aligned`; walking keeps the real offset. Cycling and driving add a presentation-only lead of at most one fix interval that never passes the upcoming maneuver and stops on degraded, late or recovering fixes; it never feeds navigation state. When a provider omits speed or course, the planner derives them from consecutive accepted fixes for presentation only. +The camera planner (`src/features/navigation/guidance-camera.ts`) produces one frame per distinct fix. The map eases linearly to it over the measured fix interval, so the puck (drawn at the camera anchor while following) and the map move on one clock with React rendering at 1 Hz. It is course-up with circular filtering (the short way across north) and holds its bearing when slow; pitch, zoom and the puck anchor are per mode (walking 34°, zoom 18.3, 67% of the map left between banner and strip; cycling 42°, 17.1–18, 71.5%; driving 48°, 15.7–17.7 by smoothed speed, 73.5%). The anchor is placed with top padding: MapLibre centres the padded rectangle, so bottom padding alone would raise the puck. Turn framing starts 8/10/12 s before the maneuver (walking/cycling/driving), keeps the junction and a short outgoing path (and a second turn that follows within about ten seconds) inside the visible map, and releases over 2–3 s. Cycling and driving draw at the route-snapped position only while `alignment` is `aligned`; walking keeps the real offset. Cycling and driving add a presentation-only lead of at most one fix interval that never passes the upcoming maneuver and stops on degraded, late or recovering fixes; it never feeds navigation state. When a provider omits speed or course, the planner estimates them for presentation only: a displacement counts only beyond the combined horizontal accuracy of the two fixes (at least 3 m, within 10 s), entering motion needs two consecutive consistent estimates, the course accuracy reports the geometric uncertainty, and stationary jitter yields no speed, course or lead. -Camera intent is follow, free or overview. A gesture enters free at gesture start (`onRegionWillChange` with user interaction) and blocks every pending move; **Ricentra** restores the follow pose in one 500 ms transition; overview frames the remaining route north-up and flat once. Fixes and reroutes never take the camera back from free or overview. +Camera intent is follow, free or overview. A gesture enters free at gesture start (`onRegionWillChange` with user interaction) and blocks every pending move; **Ricentra** restores the follow pose in one 500 ms transition (in a transit ride or wait it fits the current leg again); overview frames the remaining route north-up and flat once. Fixes and reroutes never take the camera back from free or overview. The visible map is a rectangle: below the banner, above the strip and, in a landscape layout, left of the side panel; anchoring, projection and fits use it. Leaving guidance returns the browsing map to north-up and flat with whichever browse camera command is issued next. Development builds log `[nav-cam]` rows comparing MapLibre's own `project()` of the camera centre and the next junction with the planner (anchor error, projection error, commanded versus native zoom/bearing). Emulator replays (`adb shell cmd location providers set-test-provider-location` at 1 Hz) exercise this path; physical-device GPS, frame pacing and battery use remain separate acceptance. diff --git a/docs/development/ux.md b/docs/development/ux.md index 547afa4..b7eacc5 100644 --- a/docs/development/ux.md +++ b/docs/development/ux.md @@ -67,8 +67,8 @@ Trasporti lists the nearest pilot rail stations above the GTT stops; a station o Road guidance is first-person: a flush banner in the chrome colour on top, the map with the puck low in the space between banner and strip, and a compact bottom strip. -- **Banner:** a maneuver glyph drawn from the OSRM type and modifier (straight, slight/normal/sharp turns, U-turn, fork, merge, ramps, roundabout with exit number and circulation, arrival; an unknown maneuver shows a neutral glyph with the supplied text, never a guessed turn), the distance in heavy Mona Sans with a smaller unit, then the street and the action in Geist with two lines reserved. A reserved row shows **Poi …** only when the following maneuver comes within about ten seconds of travel after the upcoming one; otherwise it holds the status (**Ricalcolo del percorso…**, **Fuori percorso**, reduced precision, **Guida in pausa · Ultima indicazione**, the search signal). Status never changes the banner height. -- **Strip:** arrival time labelled **arrivo stimato**, remaining time and distance **senza traffico**, the voice toggle (active, muted and unavailable are distinct icons and labels), overview and **Interrompi**. Tapping the summary opens details. **Riprova** appears only beside an active problem. A paused position never advances an apparently current arrival time: the strip shows **Stima sospesa** and labels the remaining values as the last estimate. +- **Banner:** a maneuver glyph drawn from the OSRM type and modifier (straight, slight/normal/sharp turns, U-turn, fork, merge, ramps, roundabout with exit number and circulation, arrival; an unknown maneuver shows a neutral glyph with the supplied text, never a guessed turn), the distance in heavy Mona Sans with a smaller unit, then the street and the action in Geist with two lines reserved. A reserved row shows **Poi …** only when the following maneuver comes within about ten seconds of travel after the upcoming one; a roundabout exit number sits beside its glyph. Status (**Ricalcolo del percorso…**, **Fuori percorso**, reduced precision, **Guida in pausa · Ultima indicazione**, the search signal) floats in its own pill just below the banner, so a warning is never hidden by **Poi**; both are also in the banner's spoken label. Each banner row has a fixed height measured for the current font scale (text capped at 2×), so no instruction or status changes the banner height. +- **Strip:** arrival time labelled **arrivo stimato**, remaining time and distance **senza traffico**, the voice toggle (active, muted and unavailable are distinct icons and labels), overview and **Interrompi**. On narrow screens or with large text the summary takes its own row above the controls, so no label or number is truncated. Tapping the summary opens details. **Riprova** appears only beside an active problem, floating above the strip with Ricentra. A paused position never advances an apparently current arrival time: the strip shows **Stima sospesa** and labels the remaining values as the last estimate. - **Map:** the remaining route in the brand ink with a contrasting casing, the travelled part thinner and muted, one cased arrow through the next junction from the real geometry, and the puck (a wedge with a live green centre, a disc when the direction is unknown, a subdued ring for a retained position). Driving and cycling hide generic business dots and labels but keep street names; driving shows one-way chevrons. Prioritize the next instruction, map, current problem and Stop action. Present recovery beside the problem. Keep voice status and setup in navigation details. Anchor the active transit confirmation beside Stop. Transit following has its own screen, not the road panel: the stage and instruction on top, the next boarding with its live provenance (or **Corsa non confermata**), the stop to get off at, journey age and passed/missed warnings, then the remaining timeline; the large confirmation sits beside Stop. Preserve transit confirmation controls and uncertainty when simplifying the layout. Route previews remain planning; native voice, position and background behavior require the separate [navigation acceptance checks](navigation.md). diff --git a/src/features/app/AppShell.tsx b/src/features/app/AppShell.tsx index a2c2f46..447addf 100644 --- a/src/features/app/AppShell.tsx +++ b/src/features/app/AppShell.tsx @@ -65,10 +65,14 @@ export function AppShell() { const message = location.message || feedback.message; const dismissMessage = () => location.message ? location.setMessage("") : feedback.dismiss(); // Measured guidance chrome: the camera places the puck inside the map left between them. - const [guidanceChrome, setGuidanceChrome] = useState({ top: 120, bottom: 190 }); - const guidanceViewport = useMemo(() => ({ width, height: mapHeight, top: Math.min(guidanceChrome.top, mapHeight - 160), bottom: Math.max(Math.min(guidanceChrome.top, mapHeight - 160) + 120, mapHeight - guidanceChrome.bottom) }), - [width, mapHeight, guidanceChrome]); - const onGuidanceChrome = (top: number, bottom: number) => setGuidanceChrome(current => Math.abs(current.top - top) < 1 && Math.abs(current.bottom - bottom) < 1 ? current : { top, bottom }); + // `right` is a side panel's width (landscape), so the map left of it is what the camera frames. + const [guidanceChrome, setGuidanceChrome] = useState({ top: 120, bottom: 190, right: 0 }); + const guidanceViewport = useMemo(() => { + const top = Math.min(guidanceChrome.top, mapHeight - 160); + return { width, height: mapHeight, top, bottom: Math.max(top + 120, mapHeight - guidanceChrome.bottom), left: 0, right: Math.max(160, width - guidanceChrome.right) }; + }, [width, mapHeight, guidanceChrome]); + const onGuidanceChrome = (top: number, bottom: number, right = 0) => setGuidanceChrome(current => + Math.abs(current.top - top) < 1 && Math.abs(current.bottom - bottom) < 1 && Math.abs(current.right - right) < 1 ? current : { top, bottom, right }); const overlayPosition = { bottom: !wide && panelVisible ? currentSheetHeight + 24 : 88, left: wide && panelVisible ? SIDE_SHEET_WIDTH + 8 : 16, right: 16 }; return ( diff --git a/src/features/map/MapCanvas.native.tsx b/src/features/map/MapCanvas.native.tsx index 9af610f..2fe9b4c 100644 --- a/src/features/map/MapCanvas.native.tsx +++ b/src/features/map/MapCanvas.native.tsx @@ -11,6 +11,7 @@ import { lineLayout, markerLabelLayout, overlayPaint } from './map-overlay-style import { GUIDANCE_IMAGES, puckImage, puckLayout } from './guidance-puck'; import { BasemapGuidanceAdjustments, GuidanceRouteLayers } from './GuidanceMapLayers'; import { useGuidanceCameraDriver } from './useGuidanceCameraDriver'; +import { createOrientationReset } from './orientation-reset'; /** * The one native map. An appearance change swaps `mapStyle` and layer paint in place: Map and Camera @@ -41,17 +42,16 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi // (including after a pan) moves into the newly visible area instead of under the sheet. const { top = 0, right = 0, bottom = 0, left = 0 } = cameraPadding ?? {}; const guiding = !!guidance; - const leftGuidance = useRef(false); + // After guidance the browsing map returns to north-up and flat, carried by whichever browse + // command is actually issued next (see orientation-reset.ts). + const orientation = useRef(createOrientationReset()); useEffect(() => { - if (guiding) { leftGuidance.current = true; return; } + if (guiding) { orientation.current.arm(); return; } if (!loaded || followLocation === true) return; - // Right after guidance the browsing map also returns to north-up and flat. - const pose = leftGuidance.current ? { bearing: 0, pitch: 0 } : {}; - leftGuidance.current = false; let current = true; const issued = commands.current; void map.current?.getCenter().then(center => { - if (current && issued === commands.current) camera.current?.easeTo({ center, ...pose, padding: { top, right, bottom, left }, duration: 250 }); + if (current && issued === commands.current) camera.current?.easeTo(orientation.current.apply({ center, padding: { top, right, bottom, left }, duration: 250 })); }).catch(() => undefined); return () => { current = false; }; }, [loaded, top, right, bottom, left, followLocation, guiding]); @@ -64,15 +64,15 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi // fitBounds has no zoom cap here, and padding taller than the map zoomed to the maximum (a blank // building interior for two results 30 m apart): ease to a computed, capped camera instead. const inset = padding.current ?? { top: 50, right: 50, bottom: 50, left: 50 }; - camera.current?.easeTo({ ...frameCamera(frameBounds, size.current, inset), padding: inset, duration: 500 }); + camera.current?.easeTo(orientation.current.apply({ ...frameCamera(frameBounds, size.current, inset), padding: inset, duration: 500 })); }, [loaded, frameKey, frameBounds]); const gesture = useGuidanceCameraDriver({ guidance: guidance ?? null, loaded, camera, map, commands, size }); - useEffect(() => { if (followLocation !== false && !guiding) { commands.current += 1; camera.current?.easeTo({ center: [longitude, latitude], zoom, padding: padding.current, duration: 450 }); } }, [longitude, latitude, zoom, followLocation, cameraRevision, guiding]); + useEffect(() => { if (followLocation !== false && !guiding) { commands.current += 1; camera.current?.easeTo(orientation.current.apply({ center: [longitude, latitude] as [number, number], zoom, padding: padding.current, duration: 450 })); } }, [longitude, latitude, zoom, followLocation, cameraRevision, guiding]); useEffect(() => { if (followLocation !== undefined || !framing.current.claim(routeFitKey, !!route?.coordinates.length) || !route) return; const xs = route.coordinates.map(p => p[0]!); const ys = route.coordinates.map(p => p[1]!); commands.current += 1; - camera.current?.fitBounds([Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)], { padding: padding.current ?? { top: 50, right: 50, bottom: 50, left: 50 }, duration: 500 }); + camera.current?.fitBounds([Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)], orientation.current.apply({ padding: padding.current ?? { top: 50, right: 50, bottom: 50, left: 50 }, duration: 500 })); }, [route, routeFitKey, followLocation]); // Follow: the puck is drawn at the camera's anchor, so it and the map share one animation clock. // Free, overview or a paused fix: a map symbol at the accepted (or retained) position. @@ -87,7 +87,7 @@ export default function MapCanvas({ center, zoom = 14.5, cameraRevision, routeFi onMapPress?.(event.nativeEvent.lngLat)} // A user gesture outranks a pending padding re-centre (see `commands`). - onRegionWillChange={event => { if (event.nativeEvent.userInteraction) { commands.current += 1; gesture(); } }} + onRegionWillChange={event => { if (event.nativeEvent.userInteraction) { commands.current += 1; if (!guiding) orientation.current.userMoved(); gesture(); } }} onRegionDidChange={event => { const { center: shown, zoom: shownZoom, userInteraction } = event.nativeEvent; onViewChanged?.(shown, shownZoom); diff --git a/src/features/map/orientation-reset.test.ts b/src/features/map/orientation-reset.test.ts new file mode 100644 index 0000000..8d8fbdb --- /dev/null +++ b/src/features/map/orientation-reset.test.ts @@ -0,0 +1,21 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { createOrientationReset } from './orientation-reset'; + +test('the reset survives a superseded command and is carried by the next issued one, once', () => { + const reset = createOrientationReset(); + assert.deepEqual(reset.apply({ duration: 250 }), { duration: 250 }, 'nothing armed: unchanged'); + reset.arm(); + // The padding re-centre was superseded before its async centre resolved: it never called apply. + // The browsing follow ease issued in the same flush carries the pose instead. + assert.deepEqual(reset.apply({ duration: 450 }), { duration: 450, bearing: 0, pitch: 0 }); + assert.equal(reset.armed, false); + assert.deepEqual(reset.apply({ duration: 250 }), { duration: 250 }, 'applied once only'); +}); + +test('a user gesture after guidance keeps the chosen view', () => { + const reset = createOrientationReset(); + reset.arm(); + reset.userMoved(); + assert.deepEqual(reset.apply({ duration: 250 }), { duration: 250 }); +}); diff --git a/src/features/map/orientation-reset.ts b/src/features/map/orientation-reset.ts new file mode 100644 index 0000000..b2e203d --- /dev/null +++ b/src/features/map/orientation-reset.ts @@ -0,0 +1,21 @@ +/** + * The browsing map returns to north-up and flat after guidance. Several browse commands can race + * when guidance closes (padding re-centre, follow ease, route fit); some are skipped because a newer + * command superseded them. The reset therefore stays armed until a command that is actually issued + * carries it, and only a user gesture (a deliberate view) cancels it. + */ +export function createOrientationReset() { + let armed = false; + return { + arm() { armed = true; }, + get armed() { return armed; }, + /** A user gesture chose the view: no reset is applied any more. */ + userMoved() { armed = false; }, + /** Adds the north-up, flat pose to the command being issued, once. */ + apply(options: T): T & { bearing?: number; pitch?: number } { + if (!armed) return options; + armed = false; + return { ...options, bearing: 0, pitch: 0 }; + }, + }; +} diff --git a/src/features/map/useGuidanceCameraDriver.ts b/src/features/map/useGuidanceCameraDriver.ts index 56e37f1..e6a7754 100644 --- a/src/features/map/useGuidanceCameraDriver.ts +++ b/src/features/map/useGuidanceCameraDriver.ts @@ -3,13 +3,15 @@ import type { CameraRef, MapRef } from '@maplibre/maplibre-react-native'; import type { GuidanceMapState } from '../navigation/useGuidanceCamera'; import type { CameraFrame } from '../navigation/guidance-camera'; import { project } from '../navigation/map-projection'; +import { pendingGuidanceCommand, type IssuedCommands } from '../navigation/guidance-commands'; /** Development-only screen assertions, read from the device log (`[nav-cam]`). */ const ASSERT = typeof __DEV__ !== 'undefined' && __DEV__; /** - * Issues the guidance camera: one native ease per frame in follow, one fit per overview request, - * nothing in free. A gesture is reported at its start and blocks every pending move at once. + * Issues the guidance camera (see `pendingGuidanceCommand`): one native ease per frame in follow, a + * fit per transit leg or overview request, nothing in free. A gesture is reported at its start and + * blocks every pending move at once. */ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, commands, size }: { guidance: GuidanceMapState | null; loaded: boolean; camera: RefObject; map: RefObject; @@ -19,37 +21,30 @@ export function useGuidanceCameraDriver({ guidance, loaded, camera, map, command const frame = guidance?.frame ?? null; const overview = guidance?.overview ?? null; const fit = guidance?.fit ?? null; - const issued = useRef(null); - const overviewIssued = useRef(null); - const fitIssued = useRef(null); + const issued = useRef({ frame: null, overview: null, fit: null }); const gestureActive = useRef(false); const latest = useRef(guidance); latest.current = guidance; useEffect(() => { if (intent !== 'free') gestureActive.current = false; }, [intent]); useEffect(() => { - if (!loaded || !frame || intent !== 'follow' || gestureActive.current || issued.current === frame.key) return; - issued.current = frame.key; + if (!loaded || !intent) return; + const command = pendingGuidanceCommand({ intent, frame, overview, fit, gesture: gestureActive.current }, issued.current); + if (!command) return; + issued.current = { ...issued.current, [command.kind]: command.key }; commands.current += 1; - camera.current?.easeTo({ - center: [frame.center.longitude, frame.center.latitude], bearing: frame.bearing, pitch: frame.pitch, zoom: frame.zoom, - padding: frame.padding, duration: frame.durationMs, easing: frame.easing, - }); - if (ASSERT) assertFrame(map, frame, size.current, latest); - }, [loaded, frame, intent, camera, map, commands, size]); - useEffect(() => { - if (!loaded || !overview || intent !== 'overview' || overviewIssued.current === overview.key) return; - overviewIssued.current = overview.key; - commands.current += 1; - camera.current?.fitBounds(overview.bounds, { padding: overview.padding, bearing: 0, pitch: 0, duration: 700 }); - }, [loaded, overview, intent, camera, commands]); - // Transit without a usable fix: frame the current leg and its stop once per leg (flat, north-up). - useEffect(() => { - if (!loaded || frame || !fit || intent !== 'follow' || gestureActive.current || fitIssued.current === fit.key) return; - fitIssued.current = fit.key; - commands.current += 1; - camera.current?.fitBounds(fit.bounds, { padding: fit.padding, bearing: 0, pitch: 0, duration: 700 }); - }, [loaded, frame, fit, intent, camera, commands]); - useEffect(() => { if (!guidance) { issued.current = null; overviewIssued.current = null; fitIssued.current = null; } }, [guidance]); + if (command.kind === 'frame') { + const next = command.frame; + camera.current?.easeTo({ + center: [next.center.longitude, next.center.latitude], bearing: next.bearing, pitch: next.pitch, zoom: next.zoom, + padding: next.padding, duration: next.durationMs, easing: next.easing, + }); + if (ASSERT) assertFrame(map, next, size.current, latest); + } else { + // Overview and transit leg fits are flat and north-up. + camera.current?.fitBounds(command.fit.bounds, { padding: command.fit.padding, bearing: 0, pitch: 0, duration: 700 }); + } + }, [loaded, intent, frame, overview, fit, camera, map, commands, size]); + useEffect(() => { if (!guidance) issued.current = { frame: null, overview: null, fit: null }; }, [guidance]); return useCallback(() => { const current = latest.current; if (!current) return; diff --git a/src/features/navigation/BannerReserveProbe.tsx b/src/features/navigation/BannerReserveProbe.tsx new file mode 100644 index 0000000..6e113fd --- /dev/null +++ b/src/features/navigation/BannerReserveProbe.tsx @@ -0,0 +1,40 @@ +import { useRef } from 'react'; +import { View } from 'react-native'; +import { Display, Text } from '../../ui'; +import { MAX_FONT_SCALE, type BannerMetrics } from './guidance-layout'; + +type Row = 'firstRow' | 'street2' | 'streetAction' | 'message2' | 'thenRow'; +/** + * Android scales text non-linearly at large font sizes, so the banner's row reserves are measured + * from the tallest content each row can hold, rendered invisibly with the same type styles. The + * banner rows then have fixed heights: instruction, status or pause changes never resize it. + */ +export function BannerReserveProbe({ onMeasure }: { onMeasure: (metrics: Omit) => void }) { + const rows = useRef>>({}); + const measure = (row: Row) => (event: { nativeEvent: { layout: { height: number } } }) => { + const height = Math.ceil(event.nativeEvent.layout.height); + if (rows.current[row] === height) return; + const next = { ...rows.current, [row]: height }; + rows.current = next; + if (next.firstRow && next.street2 && next.streetAction && next.message2 && next.thenRow) { + onMeasure({ firstRow: next.firstRow, lines: Math.max(next.street2, next.streetAction, next.message2), thenRow: Math.max(22, next.thenRow) }); + } + }; + return + 0 + + {'Ag\nAg'} + + + Ag + Ag + + + {'Ag\nAg'} + + + Poi + + ; +} diff --git a/src/features/navigation/ManeuverGlyphImage.tsx b/src/features/navigation/ManeuverGlyphImage.tsx index 016d1dd..3d66e47 100644 --- a/src/features/navigation/ManeuverGlyphImage.tsx +++ b/src/features/navigation/ManeuverGlyphImage.tsx @@ -1,6 +1,7 @@ import { Image, View } from 'react-native'; import { Text } from '../../ui/Text'; import type { GlyphName, ManeuverGlyph } from './maneuver-presentation'; +import { exitNumberSize } from './exit-number'; /** Single-ink maneuver artwork (scripts/render-navigation-assets.mjs), tinted to the text colour. */ const GLYPHS: Record = { @@ -26,12 +27,13 @@ const GLYPHS: Record = { /** Decorative: the banner's accessibility label already says what the glyph shows. */ export function ManeuverGlyphImage({ glyph, size, color }: { glyph: ManeuverGlyph; size: number; color: string }) { - return + const exitSize = exitNumberSize(size); + return {glyph.exit !== undefined ? ( - {glyph.exit} + {glyph.exit} ) : null} ; } diff --git a/src/features/navigation/NavigationPanel.tsx b/src/features/navigation/NavigationPanel.tsx index 1e26042..e87910b 100644 --- a/src/features/navigation/NavigationPanel.tsx +++ b/src/features/navigation/NavigationPanel.tsx @@ -10,9 +10,13 @@ import { journeyDuration } from '../planner/journey-presentation'; import type { CameraIntent } from './guidance-camera'; import { bannerDistance, maneuverGlyph, maneuverLines, thenManeuver } from './maneuver-presentation'; import { ManeuverGlyphImage } from './ManeuverGlyphImage'; +import { bannerMetrics, MAX_FONT_SCALE, stripLayout, type BannerMetrics } from './guidance-layout'; +import { BannerReserveProbe } from './BannerReserveProbe'; import type { NavigationState } from './navigation-controller'; const distance = (meters: number) => meters < 1000 ? `${Math.round(meters)} m` : `${(meters / 1000).toFixed(1).replace('.', ',')} km`; +/** Landscape side panel width (dp): the strip and details move beside the map. */ +const SIDE_PANEL = 320; const clock = (value: number) => new Date(value).toLocaleTimeString('it-IT', { hour: '2-digit', minute: '2-digit' }); /** @@ -23,7 +27,7 @@ const clock = (value: number) => new Date(value).toLocaleTimeString('it-IT', { h export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onOverview, onChromeLayout, onStop, onRetry, onMute, onConfirmTransit, onReplan }: NavigationState & { following: boolean; intent: CameraIntent; onRecenter: () => void; onOverview: () => void; /** Heights of the banner and the bottom strip, so the camera anchors the puck between them. */ - onChromeLayout: (top: number, bottom: number) => void; + onChromeLayout: (top: number, bottom: number, right?: number) => void; onStop: () => void; onRetry: () => void; onMute: () => void; onConfirmTransit: (action: TransitConfirmation) => void; onReplan: () => void; }) { @@ -35,6 +39,7 @@ export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onO const banner = useRef(0); const strip = useRef(0); const [stripHeight, setStripHeight] = useState(0); + const [bannerHeight, setBannerHeight] = useState(0); const transitMode = snapshot.mode === 'transit'; const waiting = busy === 'start' || snapshot.status === 'waiting-for-fix' || snapshot.status === 'routing' || snapshot.status === 'rerouting'; const remainingSeconds = !transitMode ? snapshot.durationRemainingSeconds : undefined; @@ -50,7 +55,8 @@ export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onO const confirmation: TransitConfirmation | undefined = transit?.canConfirmWalking ? 'walk-complete' : transit?.canConfirmBoarding ? 'board' : transit?.canConfirmAlighting ? 'alight' : undefined; const source = snapshot.route?.source ?? (transitMode ? 'MATO / 5T' : 'FOSSGIS / OpenStreetMap'); const landscape = width >= 650 && height < 500; - const report = () => onChromeLayout(banner.current, strip.current); + // Landscape: the strip is a side panel on the right, not a bottom occlusion. + const report = () => landscape ? onChromeLayout(banner.current, 0, SIDE_PANEL) : onChromeLayout(banner.current, strip.current, 0); // Banner content: the upcoming maneuver while there is one (kept, labelled, while paused). const maneuver = snapshot.upcomingManeuver; @@ -64,86 +70,112 @@ export function NavigationPanel({ snapshot, busy, error, intent, onRecenter, onO const statusTone = paused || snapshot.status === 'off-route' || (!searching && text.precision) ? 'text-caution' : 'text-secondary'; const problem = snapshot.problem && !(paused && snapshot.problem.startsWith('location-') && !snapshot.canRetry) ? text.quality : null; const showRetry = snapshot.canRetry && !confirmation && (!!snapshot.problem || snapshot.status === 'interrupted' || snapshot.status === 'off-route' || text.searching); - const bannerLabel = showManeuver ? `${meters ? `Tra ${meters.label}, ` : ''}${maneuver?.instruction ?? snapshot.instruction ?? ''}` : `${text.header}. ${text.instruction}`; + const thenText = then ? maneuverLines(then, then.instruction).secondary ?? then.instruction : null; + const bannerLabel = (showManeuver ? `${meters ? `Tra ${meters.label}, ` : ''}${maneuver?.instruction ?? snapshot.instruction ?? ''}` : `${text.header}. ${text.instruction}`) + + (thenText ? `. Poi ${thenText}` : '') + (status ? `. ${status}` : ''); const voice = snapshot.voice === 'ready' ? { icon: 'volume-high-outline' as const, label: 'Voce attiva. Disattiva la voce' } : snapshot.voice === 'muted' ? { icon: 'volume-mute-outline' as const, label: 'Voce disattivata. Attiva la voce' } : snapshot.voice === 'initializing' ? { icon: 'volume-low-outline' as const, label: 'Preparazione della voce' } : { icon: 'volume-off-outline' as const, label: 'Voce non disponibile: nessuna voce italiana offline' }; - const glyphSize = Math.round(44 * Math.min(fontScale, 1.3)); - // Height of the 42 sp distance line; every banner state reserves it. - const firstRow = Math.round(48 * Math.min(fontScale, 1.5)); + // Formula reserves until the probe measures the real (non-linearly scaled) text heights. + const [measured, setMeasured] = useState<{ scale: number; rows: Omit } | null>(null); + const metrics = measured && measured.scale === fontScale ? { ...bannerMetrics(fontScale), ...measured.rows } : bannerMetrics(fontScale); + const glyphSize = metrics.glyph; + const firstRow = metrics.firstRow; + const stacked = stripLayout(width, fontScale) === 'stacked' && !landscape; + + const summary = ( + setDetailsOpen(true)}> + {arrival ? + {arrival} + + {stacked ? arrivo stimato · senza traffico : <> + arrivo stimato + senza traffico + } + + : {remainingSeconds != null && paused ? 'Stima sospesa' : terminal ? text.header : 'Il tuo viaggio'}} + {!transit && snapshot.distanceRemainingMeters != null && !terminal + ? {remainingSeconds != null ? `${journeyDuration(remainingSeconds)} · ` : ''}{distance(snapshot.distanceRemainingMeters)} + : transit ? {`Tratta ${transit.legIndex + 1} di ${transit.legCount}`} : null} + + ); + const controls = <> + {!terminal && snapshot.sessionId ? : null} + {!terminal ? : null} + + ; return { banner.current = event.nativeEvent.layout.height; report(); }} - style={{ backgroundColor: colors.chrome, ...hairlines.bottom, ...(landscape ? { position: 'absolute', top: 0, left: 0, right: 320 } : {}) }} className="px-4 pb-2 pt-3"> + onLayout={event => { banner.current = event.nativeEvent.layout.height; setBannerHeight(banner.current); report(); }} + style={{ backgroundColor: colors.chrome, ...hairlines.bottom, ...(landscape ? { position: 'absolute', top: 0, left: 0, right: SIDE_PANEL } : {}) }} className="px-4 pb-2 pt-3"> + setMeasured(current => current && current.scale === fontScale + && current.rows.firstRow === rows.firstRow && current.rows.lines === rows.lines && current.rows.thenRow === rows.thenRow ? current : { scale: fontScale, rows })} /> + {/* Every row has a fixed height for the font scale (guidance-layout.ts): no instruction, + status or pause changes the banner height, so the camera anchor never moves. */} - + {showManeuver ? : waiting ? : } {showManeuver ? <> - {/* Reserved even when the distance is withheld (paused), so the banner never changes height. */} - - {meters ? <>{meters.value} - {meters.unit} : null} + + {meters ? <>{meters.value} + {meters.unit} : null} - {/* Two lines reserved: street (or the whole instruction), then the action. */} - - {lines.primary} - {lines.secondary ? {lines.secondary} : null} + {/* Street on two lines, or one street line and the action. */} + + {lines.primary} + {lines.secondary ? {lines.secondary} : null} : <> - {text.header} - - {text.instruction} + {text.header} + + {text.instruction} } - {/* Reserved rows: "Poi …" and status never change the banner height. */} - + {/* "Poi …" only; status has its own space below the banner, so neither hides the other. */} + {then ? <> - Poi + Poi - {maneuverLines(then, then.instruction).secondary ?? then.instruction} - : status ? {status} : null} + {thenText} + : null} + {/* Status (reduced precision, rerouting, off route, paused, search signal) floats just below the + banner, clear of the attribution control, so it never competes with "Poi" for space and never + changes the layout. */} + {status ? + + {status} + + : null} + { strip.current = event.nativeEvent.layout.height; setStripHeight(strip.current); report(); }} - style={[hairlines.top, landscape ? { position: 'absolute', right: 0, top: 0, bottom: 0, width: 320 } : null]} className="bg-surface px-3 pb-2 pt-2"> - - setDetailsOpen(true)}> - {arrival ? - {arrival} - - arrivo stimato - senza traffico - - : {remainingSeconds != null && paused ? 'Stima sospesa' : terminal ? text.header : 'Il tuo viaggio'}} - {!transit && snapshot.distanceRemainingMeters != null && !terminal - ? {remainingSeconds != null ? `${journeyDuration(remainingSeconds)} · ` : ''}{distance(snapshot.distanceRemainingMeters)} - : transit ? {`Tratta ${transit.legIndex + 1} di ${transit.legCount}`} : null} - - {!terminal && snapshot.sessionId ? : null} - {!terminal ? : null} - - + style={[hairlines.top, landscape ? { position: 'absolute', right: 0, top: 0, bottom: 0, width: SIDE_PANEL } : null]} className="bg-surface px-3 pb-2 pt-2"> + {/* One row when the summary has room; otherwise the summary takes its own row above the + controls (guidance-layout.ts), so labels and numbers are never truncated. */} + {stacked ? <>{summary}{controls} + : {summary}{controls}} {/* Above the strip, over the map: a problem or Ricentra never changes the strip height, so the camera's anchor (and the puck) never jump. It lives in the screen container: Android delivers no touches to children drawn outside their parent's bounds. */} - + {intent !== 'follow' && snapshot.location ? diff --git a/src/features/navigation/exit-number.ts b/src/features/navigation/exit-number.ts new file mode 100644 index 0000000..0e4768f --- /dev/null +++ b/src/features/navigation/exit-number.ts @@ -0,0 +1,6 @@ +/** + * Exit number size for a glyph box: in proportion to the glyph (about a third), never below 11 sp. + * It is laid out beside the glyph, not over it, so it never collides with neighbouring text at any + * font scale. + */ +export const exitNumberSize = (glyphSize: number) => Math.max(11, Math.round(glyphSize * 0.36)); diff --git a/src/features/navigation/guidance-camera.test.ts b/src/features/navigation/guidance-camera.test.ts index 2494507..4ce75c9 100644 --- a/src/features/navigation/guidance-camera.test.ts +++ b/src/features/navigation/guidance-camera.test.ts @@ -1,7 +1,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import { CAMERA_PROFILES, followsClosely, framesManeuver, GuidanceCamera, nextIntent, overviewBounds, type CameraFrame, type CameraInput } from './guidance-camera'; -import { maneuverPoint, PHONE, routeFixture, trajectory, TURIN } from './guidance-fixtures'; +import { LANDSCAPE, maneuverPoint, PHONE, routeFixture, trajectory, TURIN } from './guidance-fixtures'; import { inside, paddingForAnchor, principalPoint, project } from './map-projection'; import { angleDelta, distanceMeters, offsetCoordinate, offsetOfIndex } from './route-measure'; @@ -189,3 +189,33 @@ test('providers without speed or course: kinematics are derived from consecutive assert.ok(Math.abs(angleDelta(frames[7]!.bearing, 300)) < 1); assert.ok(frames[7]!.leadMeters > 5, 'derived speed allows the bounded lead'); }); + +test('stationary replay without platform kinematics: no bearing swings, no lead, no fabricated course (bike and car)', () => { + const fixture = routeFixture([{ bearing: 0, meters: 400 }, { bearing: 90, meters: 200, modifier: 'right' }]); + for (const mode of ['bicycle', 'car'] as const) { + const inputs = trajectory(fixture, { mode, speed: 0, seconds: 30, startOffset: 120, alignment: 'deviating' }).map((input, t) => { + const { speedMps: _speed, course: _course, courseAccuracyDegrees: _accuracy, ...fix } = input.fix!; + return { ...input, fix: { ...fix, ...offsetCoordinate(input.fix!, t % 2 ? 90 : 270, 2) } }; + }); + const frames = run(inputs); + assert.ok(frames.every(frame => frame.bearing === frames[0]!.bearing), `${mode} bearing held`); + assert.ok(frames.every(frame => frame.leadMeters === 0), `${mode} no lead`); + assert.ok(frames.every(frame => frame.puck.kind === 'dot'), `${mode} direction stays unknown`); + } +}); + +test('landscape side panel: the puck is centred in the map left of the panel and turns are framed there', () => { + const fixture = routeFixture([{ bearing: 0, meters: 400 }, { bearing: 90, meters: 300, modifier: 'right' }]); + const view = { width: LANDSCAPE.width, height: LANDSCAPE.height }; + const rectangle = { left: LANDSCAPE.left + 16, right: LANDSCAPE.right - 16, top: LANDSCAPE.top + 12, bottom: LANDSCAPE.bottom - 12 }; + const frames = run(trajectory(fixture, { mode: 'car', speed: 10, seconds: 40, viewport: LANDSCAPE })); + for (const frame of frames.slice(3)) { + const puck = project(frame, view, frame.center)!; + assert.ok(Math.abs(puck.x - (LANDSCAPE.left + LANDSCAPE.right) / 2) < 0.01, `x ${puck.x}`); + assert.ok(puck.x < LANDSCAPE.right, 'never under the side panel'); + assert.equal(frame.anchor.x, (LANDSCAPE.left + LANDSCAPE.right) / 2); + } + const framed = frames.filter(frame => frame.framing).slice(2); + assert.ok(framed.length > 0); + for (const frame of framed) for (const point of frame.framing!.points) assert.ok(inside(project(frame, view, point), rectangle), 'junction inside the map left of the panel'); +}); diff --git a/src/features/navigation/guidance-camera.ts b/src/features/navigation/guidance-camera.ts index 51e2b34..4a8b5e4 100644 --- a/src/features/navigation/guidance-camera.ts +++ b/src/features/navigation/guidance-camera.ts @@ -1,7 +1,8 @@ import type { Coordinate } from '../../domain/types'; import type { FollowingManeuver, GuidanceManeuver, NavigationFix, RouteProgress } from '../../domain/navigation'; import { inside, paddingForAnchor, project, type CameraPose, type Padding, type ScreenPoint, type VisibleRect } from './map-projection'; -import { angleDelta, bearingDegrees, distanceMeters, normalizeBearing, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, sliceRoute, type RouteMeasure } from './route-measure'; +import { MotionEstimator } from './motion-estimator'; +import { angleDelta, distanceMeters, normalizeBearing, offsetCoordinate, offsetOfIndex, pointAt, routeBearingAt, sliceRoute, type RouteMeasure } from './route-measure'; export type CameraMode = 'walk' | 'bicycle' | 'car'; @@ -56,8 +57,11 @@ export const CAMERA_PROFILES: Record = { }, }; -/** The unobscured map: between the bottom of the maneuver banner and the top of the bottom strip. */ -export interface GuidanceViewport { width: number; height: number; top: number; bottom: number } +/** + * The unobscured map inside the map view (screen points): below the maneuver banner, above the + * bottom strip and, in landscape, left of the side panel (`right` < `width`). + */ +export interface GuidanceViewport { width: number; height: number; top: number; bottom: number; left: number; right: number } export interface CameraInput { mode: CameraMode; @@ -134,8 +138,7 @@ export class GuidanceCamera { private mode: CameraMode | null = null; private viewportKey = ''; private recenters = 0; - private previousFix: { coordinate: Coordinate; ms: number } | null = null; - private derived: DerivedKinematics = {}; + private motion = new MotionEstimator(); get current() { return this.frame; } get expectedIntervalMs() { return this.intervals.length ? Math.min(2000, Math.max(600, median(this.intervals))) : 1000; } @@ -149,26 +152,17 @@ export class GuidanceCamera { } /** - * Some providers omit speed and course. For presentation only, derive them from the previous - * distinct accepted fix (0.5–3 s earlier); a move smaller than the fix noise yields no course. + * Some providers omit speed and course. For presentation only, an accuracy-aware estimator + * derives them from accepted fixes; stationary jitter yields neither (see MotionEstimator). */ private withKinematics(fix: NavigationFix): NavigationFix { - const ms = fix.elapsedMs ?? fix.timestamp; - const coordinate = { latitude: fix.latitude, longitude: fix.longitude }; - const previous = this.previousFix; - if (previous && ms === previous.ms) return { ...fix, ...this.derived }; - this.previousFix = { coordinate, ms }; - this.derived = {}; - if (!previous || (fix.speedMps !== undefined && fix.course !== undefined)) return fix; - const seconds = (ms - previous.ms) / 1000; - if (seconds < 0.5 || seconds > 3) return fix; - const moved = distanceMeters(previous.coordinate, coordinate); - if (fix.speedMps === undefined) this.derived.speedMps = moved / seconds; - if (fix.course === undefined && moved >= Math.max(1, 0.25 * fix.accuracyMeters)) { - this.derived.course = bearingDegrees(previous.coordinate, coordinate); - this.derived.courseAccuracyDegrees = 20; - } - return { ...fix, ...this.derived }; + if (fix.speedMps !== undefined && fix.course !== undefined) return fix; + const motion = this.motion.update({ latitude: fix.latitude, longitude: fix.longitude }, fix.elapsedMs ?? fix.timestamp, fix.accuracyMeters); + return { + ...fix, + ...(fix.speedMps === undefined ? { speedMps: motion.speedMps } : {}), + ...(fix.course === undefined && motion.course !== undefined ? { course: motion.course, courseAccuracyDegrees: motion.courseAccuracyDegrees } : {}), + }; } update(input: CameraInput): CameraFrame | null { @@ -176,7 +170,8 @@ export class GuidanceCamera { if (!input.fix) return this.frame; const fix = this.withKinematics(input.fix); const fixMs = fix.elapsedMs ?? fix.timestamp; - const viewportKey = `${input.viewport.width}x${input.viewport.height}:${input.viewport.top}:${input.viewport.bottom}`; + const { viewport } = input; + const viewportKey = `${viewport.width}x${viewport.height}:${viewport.top}:${viewport.bottom}:${viewport.left}:${viewport.right}`; const modeChanged = this.mode !== input.mode; const layoutChanged = viewportKey !== this.viewportKey; // Duplicate or re-delivered samples (GPS + fused, a re-published snapshot) never move the camera. @@ -255,10 +250,11 @@ export class GuidanceCamera { // Zoom: speed-aware cruise with hysteresis; turn framing pulls it out, release eases it back. const cruiseNow = profile.cruiseZoom(this.speed); if (this.cruise === null || Math.abs(cruiseNow - this.cruise) >= 0.3) this.cruise = cruiseNow; - const anchorY = input.viewport.top + profile.anchor * Math.max(0, input.viewport.bottom - input.viewport.top); - const padding = paddingForAnchor(input.viewport, anchorY); - const size = { width: input.viewport.width, height: input.viewport.height }; - const rect: VisibleRect = { left: 16, right: input.viewport.width - 16, top: input.viewport.top + 12, bottom: input.viewport.bottom - 12 }; + const anchorY = viewport.top + profile.anchor * Math.max(0, viewport.bottom - viewport.top); + const anchorX = (viewport.left + viewport.right) / 2; + const padding = paddingForAnchor(viewport, anchorY, anchorX); + const size = { width: viewport.width, height: viewport.height }; + const rect: VisibleRect = { left: viewport.left + 16, right: viewport.right - 16, top: viewport.top + 12, bottom: viewport.bottom - 12 }; let framing: CameraFrame['framing'] = null; let targetZoom = this.cruise; @@ -292,7 +288,7 @@ export class GuidanceCamera { key: `${fixMs}:${input.routeRevision ?? 0}:${input.mode}:${viewportKey}:${input.usable ? 1 : 0}`, center, bearing: normalizeBearing(bearing), pitch: profile.pitch, zoom: round(this.zoom, 3), padding, durationMs: recovering ? 500 : interval, easing: recovering ? 'ease' : 'linear', - anchor: { x: input.viewport.width / 2, y: anchorY }, + anchor: { x: anchorX, y: anchorY }, puck: { coordinate: base, heading: this.bearingTrusted ? normalizeBearing(bearing) : null, kind }, framing, leadMeters: round(lead, 1), }; @@ -300,7 +296,6 @@ export class GuidanceCamera { } } -export interface DerivedKinematics { speedMps?: number; course?: number; courseAccuracyDegrees?: number } const round = (value: number, digits: number) => Math.round(value * 10 ** digits) / 10 ** digits; /** At most `count` evenly spread points (always including both ends). */ function sample(points: Coordinate[], count: number): Coordinate[] { diff --git a/src/features/navigation/guidance-commands.test.ts b/src/features/navigation/guidance-commands.test.ts new file mode 100644 index 0000000..1a61291 --- /dev/null +++ b/src/features/navigation/guidance-commands.test.ts @@ -0,0 +1,35 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { legFitKey, pendingGuidanceCommand, type GuidanceFit, type IssuedCommands } from './guidance-commands'; +import { GuidanceCamera } from './guidance-camera'; +import { routeFixture, trajectory } from './guidance-fixtures'; + +const padding = { top: 0, right: 0, bottom: 0, left: 0 }; +const leg = (recenter: number): GuidanceFit => ({ key: legFitKey('s1', '2', recenter), bounds: [7.6, 45, 7.7, 45.1], padding }); +const none: IssuedCommands = { frame: null, overview: null, fit: null }; + +test('transit ride: the leg is fitted once, a pan blocks it, and Ricentra fits it again', () => { + const first = pendingGuidanceCommand({ intent: 'follow', frame: null, overview: null, fit: leg(0), gesture: false }, none); + assert.equal(first?.kind, 'fit'); + const issued = { ...none, fit: first!.key }; + assert.equal(pendingGuidanceCommand({ intent: 'follow', frame: null, overview: null, fit: leg(0), gesture: false }, issued), null, 'once per leg'); + assert.equal(pendingGuidanceCommand({ intent: 'free', frame: null, overview: null, fit: leg(0), gesture: true }, issued), null, 'free issues nothing'); + // Ricentra: follow again with the recenter counter in the fit identity. + const again = pendingGuidanceCommand({ intent: 'follow', frame: null, overview: null, fit: leg(1), gesture: false }, issued); + assert.deepEqual([again?.kind, again?.key], ['fit', 'leg:s1:2:1']); +}); + +test('road follow issues each frame once, Ricentra frames anew, overview once per request', () => { + const camera = new GuidanceCamera(); + const frame = camera.update(trajectory(routeFixture([{ bearing: 0, meters: 300 }]), { mode: 'car', speed: 10, seconds: 1 })[0]!)!; + const command = pendingGuidanceCommand({ intent: 'follow', frame, overview: null, fit: null, gesture: false }, none); + assert.equal(command?.kind, 'frame'); + const issued = { ...none, frame: frame.key }; + assert.equal(pendingGuidanceCommand({ intent: 'follow', frame, overview: null, fit: null, gesture: false }, issued), null); + assert.equal(pendingGuidanceCommand({ intent: 'follow', frame, overview: null, fit: null, gesture: true }, none), null, 'a gesture blocks pending moves'); + const recentred = camera.recenter()!; + assert.equal(pendingGuidanceCommand({ intent: 'follow', frame: recentred, overview: null, fit: null, gesture: false }, issued)?.kind, 'frame'); + const overview: GuidanceFit = { key: 'overview:1', bounds: [7.6, 45, 7.7, 45.1], padding }; + assert.equal(pendingGuidanceCommand({ intent: 'overview', frame, overview, fit: null, gesture: false }, issued)?.kind, 'overview'); + assert.equal(pendingGuidanceCommand({ intent: 'overview', frame, overview, fit: null, gesture: false }, { ...issued, overview: 'overview:1' }), null); +}); diff --git a/src/features/navigation/guidance-commands.ts b/src/features/navigation/guidance-commands.ts new file mode 100644 index 0000000..cfdd75c --- /dev/null +++ b/src/features/navigation/guidance-commands.ts @@ -0,0 +1,28 @@ +import type { CameraFrame, CameraIntent } from './guidance-camera'; +import type { Padding } from './map-projection'; + +export interface GuidanceFit { key: string; bounds: [number, number, number, number]; padding: Padding } +export interface IssuedCommands { frame: string | null; overview: string | null; fit: string | null } +export type GuidanceCommand = + | { kind: 'frame'; key: string; frame: CameraFrame } + | { kind: 'overview' | 'fit'; key: string; fit: GuidanceFit }; + +/** + * The one camera command guidance should issue now, if any: the follow frame (road or transit + * walking), otherwise the transit leg fit while following, or the overview once per request. Free + * issues nothing, and neither does a gesture still in progress. A key is issued at most once; an + * explicit Ricentra changes the follow frame key and the leg fit key, so it always moves the map. + */ +export function pendingGuidanceCommand(state: { + intent: CameraIntent; frame: CameraFrame | null; overview: GuidanceFit | null; fit: GuidanceFit | null; gesture: boolean; +}, issued: IssuedCommands): GuidanceCommand | null { + if (state.intent === 'overview') { + return state.overview && issued.overview !== state.overview.key ? { kind: 'overview', key: state.overview.key, fit: state.overview } : null; + } + if (state.intent !== 'follow' || state.gesture) return null; + if (state.frame) return issued.frame !== state.frame.key ? { kind: 'frame', key: state.frame.key, frame: state.frame } : null; + return state.fit && issued.fit !== state.fit.key ? { kind: 'fit', key: state.fit.key, fit: state.fit } : null; +} + +/** Leg fit identity: one per leg, and again after every explicit recenter request. */ +export const legFitKey = (sessionId: string | null, legKey: string, recenter: number) => `leg:${sessionId}:${legKey}:${recenter}`; diff --git a/src/features/navigation/guidance-fixtures.ts b/src/features/navigation/guidance-fixtures.ts index 5f18a24..2e16401 100644 --- a/src/features/navigation/guidance-fixtures.ts +++ b/src/features/navigation/guidance-fixtures.ts @@ -8,7 +8,9 @@ import type { CameraInput, CameraMode, GuidanceViewport } from './guidance-camer * legs in 5 m points, with one maneuver at each leg start, and a 1 Hz trajectory generator. */ export const TURIN: Coordinate = { latitude: 45.0703, longitude: 7.6869 }; -export const PHONE: GuidanceViewport = { width: 412, height: 860, top: 150, bottom: 780 }; +export const PHONE: GuidanceViewport = { width: 412, height: 860, top: 150, bottom: 780, left: 0, right: 412 }; +/** Landscape: banner over the left part, a 320 dp side panel on the right, no bottom strip. */ +export const LANDSCAPE: GuidanceViewport = { width: 915, height: 380, top: 120, bottom: 380, left: 0, right: 595 }; /** A fixture maneuver's point (fixtures always carry coordinates). */ export const maneuverPoint = (m: GuidanceManeuver): Coordinate => ({ latitude: m.latitude!, longitude: m.longitude! }); diff --git a/src/features/navigation/guidance-layout.test.ts b/src/features/navigation/guidance-layout.test.ts new file mode 100644 index 0000000..4b52715 --- /dev/null +++ b/src/features/navigation/guidance-layout.test.ts @@ -0,0 +1,22 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { bannerMetrics, MAX_FONT_SCALE, stripLayout } from './guidance-layout'; + +test('banner reserves cover the tallest text state at every font scale up to the cap', () => { + for (const scale of [1, 1.15, 1.3, 1.5, 1.8, 2, 2.5]) { + const effective = Math.min(scale, MAX_FONT_SCALE); + const metrics = bannerMetrics(scale); + assert.ok(metrics.lines >= (2 * 28) * effective, 'two street lines'); + assert.ok(metrics.lines >= (28 + 24) * effective, 'one street line plus the action'); + assert.ok(metrics.firstRow >= 42 * 1.15 * effective, 'the distance line'); + assert.ok(metrics.thenRow >= 22, 'the Poi glyph fits'); + } + assert.deepEqual(bannerMetrics(2.5), bannerMetrics(2), 'text is capped, so are the reserves'); +}); + +test('the strip stacks on narrow screens and with large text', () => { + assert.equal(stripLayout(412, 1), 'row'); + assert.equal(stripLayout(360, 1), 'stacked'); + assert.equal(stripLayout(412, 1.3), 'stacked'); + assert.equal(stripLayout(915, 1.3), 'row'); +}); diff --git a/src/features/navigation/guidance-layout.ts b/src/features/navigation/guidance-layout.ts new file mode 100644 index 0000000..99fb5e4 --- /dev/null +++ b/src/features/navigation/guidance-layout.ts @@ -0,0 +1,39 @@ +/** + * Fixed guidance chrome geometry. Every banner row has a height that depends only on the font + * scale, so no instruction, status or pause changes the banner height (and with it the camera + * anchor). Text in the banner is capped at `MAX_FONT_SCALE`. These linear reserves are an upper + * bound used until `BannerReserveProbe` measures the real heights (Android scales large text + * non-linearly, so measured rows are usually smaller). + */ +export const MAX_FONT_SCALE = 2; + +export interface BannerMetrics { + /** Glyph box (dp). */ + glyph: number; + /** Distance line: 42 sp heavy, line height 1.15. */ + firstRow: number; + /** Street (28 dp lines) and action (24 dp): two street lines, or one street line plus the action. */ + lines: number; + /** The "Poi …" row. */ + thenRow: number; +} + +export function bannerMetrics(fontScale: number): BannerMetrics { + const scale = Math.max(1, Math.min(MAX_FONT_SCALE, Number.isFinite(fontScale) ? fontScale : 1)); + return { + glyph: Math.round(44 * Math.min(scale, 1.3)), + firstRow: Math.ceil(42 * 1.15 * scale), + lines: Math.ceil(Math.max(2 * 28, 28 + 24, 2 * 24) * scale), + thenRow: Math.ceil(26 * scale), + }; +} + +/** + * Bottom strip: one row (summary, voice, overview, Interrompi) when the summary has room for + * "arrivo stimato / senza traffico" and the remaining time and distance; otherwise the summary + * takes a full row above the controls, so no label or number is truncated. + */ +export function stripLayout(width: number, fontScale: number): 'row' | 'stacked' { + const scale = Math.max(1, Number.isFinite(fontScale) ? fontScale : 1); + return width >= 400 * scale ? 'row' : 'stacked'; +} diff --git a/src/features/navigation/maneuver-presentation.test.ts b/src/features/navigation/maneuver-presentation.test.ts index 87cd3a8..fa371ab 100644 --- a/src/features/navigation/maneuver-presentation.test.ts +++ b/src/features/navigation/maneuver-presentation.test.ts @@ -41,6 +41,7 @@ test('banner distance: coarse steps, subordinate unit, Italian decimal comma', ( assert.deepEqual(bannerDistance(2), { value: '0', unit: 'm', label: '0 metri' }); assert.deepEqual(bannerDistance(347), { value: '350', unit: 'm', label: '350 metri' }); assert.deepEqual(bannerDistance(998), { value: '1', unit: 'km', label: '1 chilometro' }); + assert.deepEqual(bannerDistance(1020), { value: '1', unit: 'km', label: '1 chilometro' }); assert.deepEqual(bannerDistance(1260), { value: '1,3', unit: 'km', label: '1,3 chilometri' }); assert.deepEqual(bannerDistance(2000), { value: '2', unit: 'km', label: '2 chilometri' }); assert.equal(bannerDistance(Number.NaN).value, '–'); @@ -59,3 +60,10 @@ test('"Poi" uses the gap between maneuvers, not proximity', () => { assert.equal(thenManeuver({ ...base, followingManeuver: { ...following, afterUpcomingMeters: 600, afterUpcomingSeconds: 45 } }), null); assert.equal(thenManeuver({ ...base, distanceToManeuverMeters: 5, followingManeuver: { ...following, afterUpcomingMeters: 600, afterUpcomingSeconds: 45 } }), null, 'being close to the first turn is irrelevant'); }); + +test('the roundabout exit number scales with its glyph and stays legible', async () => { + const { exitNumberSize } = await import('./exit-number'); + assert.equal(exitNumberSize(44), 16); + assert.equal(exitNumberSize(22), 11); + assert.ok(exitNumberSize(57) > exitNumberSize(44)); +}); diff --git a/src/features/navigation/maneuver-presentation.ts b/src/features/navigation/maneuver-presentation.ts index 7b7b057..67cf8e2 100644 --- a/src/features/navigation/maneuver-presentation.ts +++ b/src/features/navigation/maneuver-presentation.ts @@ -74,7 +74,7 @@ export function bannerDistance(meters: number): { value: string; unit: string; l return { value: String(value), unit: 'm', label: `${value} metri` }; } const km = (Math.round(meters / 100) / 10).toFixed(1).replace('.', ',').replace(/,0$/, ''); - return { value: km, unit: 'km', label: `${km} chilometri` }; + return { value: km, unit: 'km', label: km === '1' ? '1 chilometro' : `${km} chilometri` }; } /** diff --git a/src/features/navigation/map-projection.ts b/src/features/navigation/map-projection.ts index 514e67f..5dce0fc 100644 --- a/src/features/navigation/map-projection.ts +++ b/src/features/navigation/map-projection.ts @@ -45,12 +45,17 @@ export function project(pose: CameraPose, size: ScreenSize, point: Coordinate): } /** - * Padding that draws the camera centre at `anchorY` (screen y, from the top). MapLibre centres the - * padded rectangle, so a LOW anchor needs TOP padding: bottom padding alone moves the centre up. + * Padding that draws the camera centre at (`anchorX`, `anchorY`), e.g. low in the map and, in + * landscape, in the middle of the map left of the side panel. MapLibre centres the padded + * rectangle, so a LOW anchor needs TOP padding: bottom padding alone moves the centre up. */ -export function paddingForAnchor(size: ScreenSize, anchorY: number): Padding { +export function paddingForAnchor(size: ScreenSize, anchorY: number, anchorX = size.width / 2): Padding { const y = Math.max(0, Math.min(size.height, anchorY)); - return { top: Math.max(0, 2 * y - size.height), right: 0, bottom: Math.max(0, size.height - 2 * y), left: 0 }; + const x = Math.max(0, Math.min(size.width, anchorX)); + return { + top: Math.max(0, 2 * y - size.height), right: Math.max(0, size.width - 2 * x), + bottom: Math.max(0, size.height - 2 * y), left: Math.max(0, 2 * x - size.width), + }; } export interface VisibleRect { left: number; top: number; right: number; bottom: number } diff --git a/src/features/navigation/motion-estimator.test.ts b/src/features/navigation/motion-estimator.test.ts new file mode 100644 index 0000000..3fa5840 --- /dev/null +++ b/src/features/navigation/motion-estimator.test.ts @@ -0,0 +1,49 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { MotionEstimator } from './motion-estimator'; +import { offsetCoordinate } from './route-measure'; +import { TURIN } from './guidance-fixtures'; + +test('stationary jitter (2 m east/west at ±5 m) never becomes motion, speed or course', () => { + const estimator = new MotionEstimator(); + for (let t = 0; t < 60; t += 1) { + const motion = estimator.update(offsetCoordinate(TURIN, t % 2 ? 90 : 270, 2), 1000 * t, 5); + assert.deepEqual(motion, { speedMps: 0, moving: false }, `t=${t}`); + } +}); + +test('jitter larger than the reported accuracy flips direction and never passes the consistency hysteresis', () => { + const estimator = new MotionEstimator(); + for (let t = 0; t < 40; t += 1) assert.equal(estimator.update(offsetCoordinate(TURIN, t % 2 ? 90 : 270, 4), 1000 * t, 3).moving, false); +}); + +test('driving at 10 m/s: motion after two consistent estimates, honest course accuracy', () => { + const estimator = new MotionEstimator(); + const results = Array.from({ length: 8 }, (_, t) => estimator.update(offsetCoordinate(TURIN, 300, 10 * t), 1000 * t, 5)); + assert.equal(results[1]!.moving, false, 'one estimate is not enough'); + assert.equal(results[2]!.moving, true); + for (const motion of results.slice(3)) { + assert.ok(Math.abs(motion.speedMps - 10) < 0.2); + assert.ok(Math.abs(motion.course! - 300) < 0.5); + assert.ok(motion.courseAccuracyDegrees! <= 27, `${motion.courseAccuracyDegrees}`); + } +}); + +test('walking at 1.4 m/s with ±5 m fixes waits for a baseline above the noise; ±25 m fixes stay unproven', () => { + const precise = new MotionEstimator(); + const walk = Array.from({ length: 12 }, (_, t) => precise.update(offsetCoordinate(TURIN, 45, 1.4 * t), 1000 * t, 5)); + assert.equal(walk[4]!.moving, false, '5.6 m < 7.1 m combined accuracy'); + assert.equal(walk[11]!.moving, true); + assert.ok(Math.abs(walk[11]!.speedMps - 1.4) < 0.1); + const coarse = new MotionEstimator(); + for (let t = 0; t < 20; t += 1) assert.equal(coarse.update(offsetCoordinate(TURIN, 45, 1.4 * t), 1000 * t, 25).moving, false); +}); + +test('stopping returns to stationary at once; duplicate sample times are ignored', () => { + const estimator = new MotionEstimator(); + for (let t = 0; t < 5; t += 1) estimator.update(offsetCoordinate(TURIN, 0, 10 * t), 1000 * t, 5); + assert.equal(estimator.current.moving, true); + assert.equal(estimator.update(offsetCoordinate(TURIN, 0, 99), 4000, 5).moving, true, 'same time: unchanged'); + for (let t = 5; t < 16; t += 1) estimator.update(offsetCoordinate(TURIN, 0, 40), 1000 * t, 5); + assert.deepEqual(estimator.current, { speedMps: 0, moving: false }); +}); diff --git a/src/features/navigation/motion-estimator.ts b/src/features/navigation/motion-estimator.ts new file mode 100644 index 0000000..6090fb7 --- /dev/null +++ b/src/features/navigation/motion-estimator.ts @@ -0,0 +1,69 @@ +import type { Coordinate } from '../../domain/types'; +import { angleDelta, bearingDegrees, distanceMeters } from './route-measure'; + +/** + * Presentation-only motion for providers that omit speed or course (some platforms, test + * providers). A displacement counts only when it exceeds the combined horizontal accuracy of the + * two fixes (and at least `minimumMeters`), measured against the most recent earlier fix that it + * clears within `windowMs`; entering "moving" needs two consecutive consistent estimates, while one + * inconclusive fix returns to stationary. Stationary jitter therefore yields no speed and no course, + * and the course accuracy reports the real geometric uncertainty instead of a fixed guess. + */ +export interface EstimatedMotion { + /** 0 while stationary or unproven. */ + speedMps: number; + course?: number; + courseAccuracyDegrees?: number; + moving: boolean; +} + +interface Sample { coordinate: Coordinate; ms: number; accuracy: number } + +export class MotionEstimator { + private samples: Sample[] = []; + private streak = 0; + private lastCourse: number | null = null; + private result: EstimatedMotion = { speedMps: 0, moving: false }; + + constructor(private readonly windowMs = 10_000, private readonly minimumMeters = 3, private readonly consistencyDegrees = 60) {} + + get current(): EstimatedMotion { return this.result; } + + /** One distinct fix (a repeated sample time returns the previous estimate). */ + update(coordinate: Coordinate, ms: number, accuracyMeters: number): EstimatedMotion { + const last = this.samples[this.samples.length - 1]; + if (last && ms <= last.ms) return this.result; + const accuracy = Number.isFinite(accuracyMeters) && accuracyMeters > 0 ? accuracyMeters : 50; + this.samples.push({ coordinate, ms, accuracy }); + while (this.samples.length > 1 && ms - this.samples[0]!.ms > this.windowMs) this.samples.shift(); + // Speed: the most recent earlier fix the displacement clears. Course: prefer a baseline twice + // the uncertainty (about 27° at worst), falling back to the clearing fix with its honest error. + let found: { distance: number; seconds: number; course: number; uncertainty: number } | null = null; + let heading: { course: number; distance: number; uncertainty: number } | null = null; + for (let i = this.samples.length - 2; i >= 0; i -= 1) { + const earlier = this.samples[i]!; + const uncertainty = Math.max(this.minimumMeters, Math.hypot(earlier.accuracy, accuracy)); + const distance = distanceMeters(earlier.coordinate, coordinate); + if (!found && distance > uncertainty) { + found = { distance, seconds: (ms - earlier.ms) / 1000, course: bearingDegrees(earlier.coordinate, coordinate), uncertainty }; + } + if (found && distance >= 2 * uncertainty) { heading = { course: bearingDegrees(earlier.coordinate, coordinate), distance, uncertainty }; break; } + } + if (found && heading) found = { ...found, course: heading.course }; + if (!found || found.seconds <= 0) { + this.streak = 0; this.lastCourse = null; + this.result = { speedMps: 0, moving: false }; + return this.result; + } + const consistent = this.lastCourse !== null && Math.abs(angleDelta(this.lastCourse, found.course)) <= this.consistencyDegrees; + this.streak = consistent ? this.streak + 1 : 1; + this.lastCourse = found.course; + if (this.streak < 2) { this.result = { speedMps: 0, moving: false }; return this.result; } + const baseline = heading ?? found; + this.result = { + speedMps: found.distance / found.seconds, course: found.course, moving: true, + courseAccuracyDegrees: Math.min(90, Math.atan2(baseline.uncertainty, baseline.distance) * 180 / Math.PI), + }; + return this.result; + } +} diff --git a/src/features/navigation/useGuidanceCamera.ts b/src/features/navigation/useGuidanceCamera.ts index bfaa92f..13be08c 100644 --- a/src/features/navigation/useGuidanceCamera.ts +++ b/src/features/navigation/useGuidanceCamera.ts @@ -4,11 +4,11 @@ import type { Coordinate, RoutePlan } from '../../domain/types'; import type { MapCamera } from '../map/useMapCamera'; import { GuidanceCamera, overviewBounds, type CameraFrame, type CameraIntent, type CameraMode, type GuidanceViewport, type PuckKind } from './guidance-camera'; import { maneuverArrow, traveledFraction, type ManeuverArrow } from './guidance-route'; -import type { Padding } from './map-projection'; import { measureRoute, type RouteMeasure } from './route-measure'; import { sessionPlan } from './transit-follow'; +import { legFitKey, type GuidanceFit } from './guidance-commands'; +export type { GuidanceFit } from './guidance-commands'; -export interface GuidanceFit { key: string; bounds: [number, number, number, number]; padding: Padding } /** What the map needs during guidance: camera intent and frames, the puck and the route styling. */ export interface GuidanceMapState { intent: CameraIntent; @@ -80,7 +80,8 @@ export function useGuidanceCamera({ snapshot, camera, viewport, active, transitP }); if (camera.guidanceRecenter !== state.recenter) { state.recenter = camera.guidanceRecenter; frame = state.camera.recenter() ?? frame; } } - const padding = useMemo(() => ({ top: viewport.top + 24, right: 32, bottom: viewport.height - viewport.bottom + 24, left: 32 }), [viewport]); + // Fits keep clear of every side: the banner, the strip and, in landscape, the side panel. + const padding = useMemo(() => ({ top: viewport.top + 24, right: viewport.width - viewport.right + 32, bottom: viewport.height - viewport.bottom + 24, left: viewport.left + 32 }), [viewport]); const overviewKey = camera.guidanceOverview; const traveled = snapshot.routeProgress?.traveledMeters ?? 0; // Framed once per explicit request: later progress or a reroute never refits it. @@ -95,9 +96,10 @@ export function useGuidanceCamera({ snapshot, camera, viewport, active, transitP const fit = useMemo(() => { if (!transit || mode || !legGeometry?.length) return null; const bounds = boundsOf(legGeometry); - return bounds ? { key: `leg:${snapshot.sessionId}:${legKey}`, bounds, padding } : null; - // eslint-disable-next-line react-hooks/exhaustive-deps -- one frame per leg - }, [transit !== undefined, mode, legKey, legGeometry !== null]); + // A new key per leg and per explicit Ricentra, so a recenter during a ride always reframes. + return bounds ? { key: legFitKey(snapshot.sessionId, legKey, camera.guidanceRecenter), bounds, padding } : null; + // eslint-disable-next-line react-hooks/exhaustive-deps -- one frame per leg and recenter request + }, [transit !== undefined, mode, legKey, legGeometry !== null, camera.guidanceRecenter]); const fraction = traveledFraction(route, snapshot.routeProgress); const upcoming = snapshot.upcomingManeuver; const arrow = useMemo(() => !transit && mode ? maneuverArrow(route, upcoming, mode, traveled) : null, diff --git a/src/theme/brand-basemap.ts b/src/theme/brand-basemap.ts index 10a7959..dacf8f0 100644 --- a/src/theme/brand-basemap.ts +++ b/src/theme/brand-basemap.ts @@ -251,9 +251,10 @@ export function brandRecipe(scheme: ColorScheme): StyleRecipe { before: 'highway-name-path', layer: { id: 'avoid_oneway', type: 'symbol', source: 'openmaptiles', 'source-layer': 'transportation', minzoom: 15, - filter: ['all', ['==', ['get', 'oneway'], 1], ['match', ['get', 'class'], ['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'minor', 'service'], true, false]], + // `oneway` 1 runs with the line geometry, -1 against it: the chevron turns round. + filter: ['all', ['match', ['get', 'oneway'], [1, -1], true, false], ['match', ['get', 'class'], ['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'minor', 'service'], true, false]], layout: { - visibility: 'none', 'symbol-placement': 'line', 'symbol-spacing': 90, 'icon-image': `oneway-${scheme}`, 'icon-rotate': 90, + visibility: 'none', 'symbol-placement': 'line', 'symbol-spacing': 90, 'icon-image': `oneway-${scheme}`, 'icon-rotate': ['match', ['get', 'oneway'], -1, 270, 90], 'icon-rotation-alignment': 'map', 'icon-allow-overlap': true, 'icon-ignore-placement': true, }, }, diff --git a/src/theme/map-style.test.ts b/src/theme/map-style.test.ts index ab98957..d32e597 100644 --- a/src/theme/map-style.test.ts +++ b/src/theme/map-style.test.ts @@ -217,3 +217,20 @@ test('POI labels name key amenities by OSM subclass, not by the broader class', assert.equal(shown({ class: 'waste_basket', subclass: 'waste_basket', rank: 1 }), false, 'unnamed bins stay hidden'); assert.equal(shown({ class: 'railway', subclass: 'tram_stop', rank: 1, name: 'Castello' }), false, 'stops use the transit rings'); }); + +test('one-way chevrons cover both directions: oneway 1 along the line, -1 turned round', () => { + for (const scheme of ['light', 'dark'] as const) { + const layer = layerOf(mapStyleFor(scheme), 'avoid_oneway'); + assert.equal(layer?.layout?.visibility, 'none', 'hidden until driving guidance shows it'); + const filter = createExpression(layer?.filter, { type: 'boolean' } as never); + const rotate = createExpression(layer?.layout?.['icon-rotate'], latest.layout_symbol['icon-rotate'] as never); + assert.equal(filter.result, 'success'); assert.equal(rotate.result, 'success'); + if (filter.result !== 'success' || rotate.result !== 'success') return; + const feature = (oneway: number) => ({ type: 'LineString', properties: { oneway, class: 'minor' } }) as never; + assert.equal(filter.value.evaluate({ zoom: 16 }, feature(1)), true); + assert.equal(filter.value.evaluate({ zoom: 16 }, feature(-1)), true); + assert.equal(filter.value.evaluate({ zoom: 16 }, feature(0)), false); + assert.equal(rotate.value.evaluate({ zoom: 16 }, feature(1)), 90); + assert.equal(rotate.value.evaluate({ zoom: 16 }, feature(-1)), 270); + } +});