@glassly/crust 0.1.0-dev.90 → 0.1.0-dev.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
android:permission="${applicationId}.permission.CRUST_NOTIFICATION_BRIDGE"
|
|
27
27
|
android:process=":notif" />
|
|
28
28
|
|
|
29
|
-
<!--
|
|
30
|
-
RouteProgress
|
|
31
|
-
NavInfoReceiverService is gone. Nothing to register here for nav. -->
|
|
29
|
+
<!-- Nothing to register for nav: the Mapbox Navigation SDK delivers
|
|
30
|
+
turn-by-turn steps inline via RouteProgress, with no IPC service. -->
|
|
32
31
|
</application>
|
|
33
32
|
</manifest>
|
|
@@ -51,35 +51,33 @@ import com.mapbox.navigation.core.trip.session.RouteProgressObserver
|
|
|
51
51
|
* Headless: never mounts a MapView. The mobile app does not render a
|
|
52
52
|
* map natively (the miniapp WebView owns the visible map).
|
|
53
53
|
*
|
|
54
|
-
* ## Contract
|
|
54
|
+
* ## Contract
|
|
55
55
|
*
|
|
56
|
-
* The public surface
|
|
57
|
-
* `simulateDeviation` / `setWrongSidewalkOffset` /
|
|
58
|
-
*
|
|
59
|
-
* `
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* this migration. See issues/mapbox-navigation-migration.md.
|
|
56
|
+
* The public surface is `start` / `stop` / `ensureTermsAccepted` /
|
|
57
|
+
* `simulateDeviation` / `setWrongSidewalkOffset` / `setSkipCrossings`, plus
|
|
58
|
+
* the `StartOptions` / `Callbacks` / `ManeuverPayload` / `LocationPayload` /
|
|
59
|
+
* `RoutePoint` / `RouteStep` types. Keep it in parity with
|
|
60
|
+
* `NavigationManager.swift` — CrustModule and everything above the bridge
|
|
61
|
+
* (the `@glassly/miniapp` SDK, the PivotEngine) code against this shape.
|
|
63
62
|
*
|
|
64
|
-
* ##
|
|
63
|
+
* ## Mapbox behaviors this wraps
|
|
65
64
|
*
|
|
66
65
|
* - **Off-route + reroute is automatic.** Mapbox detects off-route and
|
|
67
66
|
* re-requests a route by default. We surface `OffRouteObserver` →
|
|
68
67
|
* `onOffRoute`, `RerouteState` transitions → `onRerouting`, and
|
|
69
|
-
* `RoutesObserver` (new route) → `onRoute`.
|
|
70
|
-
* perpendicular detector for the live trip.
|
|
68
|
+
* `RoutesObserver` (new route) → `onRoute`. Do not hand-roll a
|
|
69
|
+
* perpendicular-distance detector for the live trip.
|
|
71
70
|
* - **Steps arrive inline** on each `RouteProgress` / off the
|
|
72
|
-
* `NavigationRoute` directlegs
|
|
73
|
-
*
|
|
74
|
-
* the Directions `LegStep` / `BannerInstructions`.
|
|
71
|
+
* `NavigationRoute` directlegs. Road names + maneuver come from the
|
|
72
|
+
* Directions `LegStep` / `BannerInstructions`.
|
|
75
73
|
* - **No T&C dialog.** Mapbox has no runtime terms screen, so
|
|
76
74
|
* `ensureTermsAccepted` resolves immediately `true` — keeping the
|
|
77
75
|
* callback shape the miniapp's `requestPermission()` expects.
|
|
78
|
-
* - **Enhanced (map-matched) location**
|
|
79
|
-
*
|
|
76
|
+
* - **Enhanced (map-matched) location** arrives via
|
|
77
|
+
* `LocationObserver.onNewLocationMatcherResult`.
|
|
80
78
|
* - **Simulation** uses `MapboxReplayer` + `ReplayRouteMapper`; the three
|
|
81
|
-
* dev walkers (deviate / wrong-sidewalk / skip-crossings)
|
|
82
|
-
*
|
|
79
|
+
* dev walkers (deviate / wrong-sidewalk / skip-crossings) push synthetic
|
|
80
|
+
* `ReplayEventUpdateLocation`s.
|
|
83
81
|
*/
|
|
84
82
|
@OptIn(ExperimentalPreviewMapboxNavigationAPI::class)
|
|
85
83
|
object NavigationManager {
|
|
@@ -693,8 +691,7 @@ object NavigationManager {
|
|
|
693
691
|
routeProgressObserver = progressObs
|
|
694
692
|
nav.registerRouteProgressObserver(progressObs)
|
|
695
693
|
|
|
696
|
-
// LocationObserver — enhanced (map-matched) location
|
|
697
|
-
// RoadSnappedLocationProvider.
|
|
694
|
+
// LocationObserver — prefer the enhanced (map-matched) location.
|
|
698
695
|
val locObs = object : LocationObserver {
|
|
699
696
|
override fun onNewRawLocation(rawLocation: Location) { /* prefer matched */ }
|
|
700
697
|
override fun onNewLocationMatcherResult(result: LocationMatcherResult) {
|
|
@@ -1012,7 +1009,6 @@ object NavigationManager {
|
|
|
1012
1009
|
|
|
1013
1010
|
// =====================================================================
|
|
1014
1011
|
// Maneuver mapping — Mapbox `type` + `modifier` → our ManeuverKind union.
|
|
1015
|
-
// (Replaces NavInfoReceiverService.mapManeuver's Google-enum table.)
|
|
1016
1012
|
// =====================================================================
|
|
1017
1013
|
|
|
1018
1014
|
/**
|
|
@@ -1061,10 +1057,10 @@ object NavigationManager {
|
|
|
1061
1057
|
/**
|
|
1062
1058
|
* Dev-only: shove the simulated puck OFF the active route so Mapbox's
|
|
1063
1059
|
* built-in off-route detection + automatic rerouting kick in — exactly
|
|
1064
|
-
* like a real GPS divergence.
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1060
|
+
* like a real GPS divergence. Do not hand-roll the off-route math or call
|
|
1061
|
+
* requestRoutes here; just teleport the replay puck `DEVIATE_OFFSET_M`
|
|
1062
|
+
* perpendicular to the route and let the SDK do the rest
|
|
1063
|
+
* (OffRouteObserver → onOffRoute, RerouteState → onRerouting,
|
|
1068
1064
|
* RoutesObserver(REROUTE) → onRoute).
|
|
1069
1065
|
*
|
|
1070
1066
|
* Requires simulate mode (a replayer to inject into). On a real-GPS trip
|
|
@@ -7,19 +7,17 @@ import MapboxNavigationCore
|
|
|
7
7
|
|
|
8
8
|
/// NavigationManager (iOS)
|
|
9
9
|
///
|
|
10
|
-
/// Singleton wrapper around the **Mapbox Navigation SDK v3 for iOS
|
|
11
|
-
///
|
|
12
|
-
///
|
|
13
|
-
///
|
|
14
|
-
/// fans out the SAME coarse callbacks the Google version exposed to
|
|
15
|
-
/// `CrustModule`.
|
|
10
|
+
/// Singleton wrapper around the **Mapbox Navigation SDK v3 for iOS**. Mirrors
|
|
11
|
+
/// the Android `NavigationManager.kt`: owns the `MapboxNavigation` lifecycle,
|
|
12
|
+
/// subscribes to the Combine publishers (route progress, location, arrival,
|
|
13
|
+
/// rerouting), and fans out coarse callbacks to `CrustModule`.
|
|
16
14
|
///
|
|
17
|
-
/// ## Contract
|
|
15
|
+
/// ## Contract
|
|
18
16
|
///
|
|
19
|
-
/// The public surface
|
|
17
|
+
/// The public surface is `start` / `stop` / `requestPermission` /
|
|
20
18
|
/// `simulateDeviation`, plus the `onEvent` / `onLocation` / `onRoute` payload
|
|
21
|
-
/// shapes
|
|
22
|
-
///
|
|
19
|
+
/// shapes. Keep it in parity with Android — `CrustModule.swift` and everything
|
|
20
|
+
/// above it (the `@glassly/miniapp` SDK) code against this shape.
|
|
23
21
|
///
|
|
24
22
|
/// ## iOS-vs-Android API differences (why this isn't a line-for-line port)
|
|
25
23
|
///
|
|
@@ -33,9 +31,8 @@ import MapboxNavigationCore
|
|
|
33
31
|
/// - Mapbox owns off-route detection + auto-reroute on iOS too, same as
|
|
34
32
|
/// Android — we observe, we don't re-derive.
|
|
35
33
|
///
|
|
36
|
-
/// VERIFY-IN-XCODE markers flag
|
|
37
|
-
///
|
|
38
|
-
/// official v3 examples.
|
|
34
|
+
/// VERIFY-IN-XCODE markers flag exact field/case/method names that the
|
|
35
|
+
/// auth-gated v3 docs could not confirm; check them against the SDK headers.
|
|
39
36
|
// @MainActor: the Mapbox Navigation v3 API surface (MapboxNavigation,
|
|
40
37
|
// NavigationController, SessionController, the routeProgress/locationMatching
|
|
41
38
|
// publishers) is main-actor-isolated. All our Mapbox access already happens on
|
|
@@ -128,9 +125,9 @@ final class NavigationManager: NSObject {
|
|
|
128
125
|
|
|
129
126
|
// MARK: - Permissions
|
|
130
127
|
|
|
131
|
-
/// Mapbox needs no Terms & Conditions dialog
|
|
132
|
-
///
|
|
133
|
-
///
|
|
128
|
+
/// Mapbox needs no Terms & Conditions dialog. Resolve immediately with
|
|
129
|
+
/// `true` so the JS permission gate passes — mirrors Android
|
|
130
|
+
/// `ensureTermsAccepted`, which is a no-op on Mapbox.
|
|
134
131
|
/// (Location authorization itself is handled by the standard iOS prompts
|
|
135
132
|
/// driven from the NSLocation* Info.plist usage strings + CoreLocation.)
|
|
136
133
|
func requestPermission(completion: @escaping (Bool) -> Void) {
|
|
@@ -421,8 +418,8 @@ final class NavigationManager: NSObject {
|
|
|
421
418
|
}
|
|
422
419
|
}
|
|
423
420
|
|
|
424
|
-
/// SDK-agnostic mode string → Mapbox Directions profile.
|
|
425
|
-
///
|
|
421
|
+
/// SDK-agnostic mode string → Mapbox Directions profile. `two_wheeler` has
|
|
422
|
+
/// no Mapbox equivalent, so it falls back to driving.
|
|
426
423
|
private func profileFor(_ mode: String) -> ProfileIdentifier {
|
|
427
424
|
switch mode.lowercased() {
|
|
428
425
|
case "walking": return .walking
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glassly/crust",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.97",
|
|
4
4
|
"description": "Glassly Native Module",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"homepage": "https://github.com/fossephate/crust#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@glassly/jspolyfill": "0.1.0-dev.
|
|
38
|
+
"@glassly/jspolyfill": "0.1.0-dev.97"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@expo/config-plugins": ">=8.0.0",
|