@complexify/expo-mapbox-navigation 1.1.8 → 1.2.0

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.
@@ -34,6 +34,330 @@ class ExpoMapboxNavigationView: ExpoView {
34
34
  override func layoutSubviews() {
35
35
  controller.view.frame = bounds
36
36
  }
37
+
38
+ // Steps List
39
+ func setStepsBackgroundColor(hexColor: String) {
40
+ controller.customDayStyle.customStepsBackgroundColor = UIColor(hex: hexColor)
41
+ controller.update()
42
+ }
43
+
44
+ func setStepsPrimaryTextColor(hexColor: String) {
45
+ controller.customDayStyle.customStepsPrimaryTextColor = UIColor(hex: hexColor)
46
+ controller.update()
47
+ }
48
+
49
+ func setStepsSecondaryTextColor(hexColor: String) {
50
+ controller.customDayStyle.customStepsSecondaryTextColor = UIColor(hex: hexColor)
51
+ controller.update()
52
+ }
53
+
54
+ func setStepsManeuverViewPrimaryColor(hexColor: String) {
55
+ controller.customDayStyle.customStepsManeuverViewPrimaryColor = UIColor(hex: hexColor)
56
+ controller.update()
57
+ }
58
+
59
+ func setStepsManeuverViewSecondaryColor(hexColor: String) {
60
+ controller.customDayStyle.customStepsManeuverViewSecondaryColor = UIColor(hex: hexColor)
61
+ controller.update()
62
+ }
63
+
64
+ func setStepsSeparatorColor(hexColor: String) {
65
+ controller.customDayStyle.customStepsSeparatorColor = UIColor(hex: hexColor)
66
+ controller.update()
67
+ }
68
+
69
+ // Lane View
70
+ func setLaneViewBackgroundColor(hexColor: String) {
71
+ controller.customDayStyle.customLaneViewBackgroundColor = UIColor(hex: hexColor)
72
+ controller.update()
73
+ }
74
+
75
+ func setLaneViewForegroundColor(hexColor: String) {
76
+ controller.customDayStyle.customLaneViewForegroundColor = UIColor(hex: hexColor)
77
+ controller.update()
78
+ }
79
+
80
+ func setLaneViewSeparatorColor(hexColor: String) {
81
+ controller.customDayStyle.customLaneViewSeparatorColor = UIColor(hex: hexColor)
82
+ controller.update()
83
+ }
84
+
85
+ // Next Banner View
86
+ func setNextBannerBackgroundColor(hexColor: String) {
87
+ controller.customDayStyle.customNextBannerBackgroundColor = UIColor(hex: hexColor)
88
+ controller.update()
89
+ }
90
+
91
+ func setNextBannerPrimaryTextColor(hexColor: String) {
92
+ controller.customDayStyle.customNextBannerPrimaryTextColor = UIColor(hex: hexColor)
93
+ controller.update()
94
+ }
95
+
96
+ func setNextBannerSecondaryTextColor(hexColor: String) {
97
+ controller.customDayStyle.customNextBannerSecondaryTextColor = UIColor(hex: hexColor)
98
+ controller.update()
99
+ }
100
+
101
+ func setNextBannerDistanceTextColor(hexColor: String) {
102
+ controller.customDayStyle.customNextBannerDistanceTextColor = UIColor(hex: hexColor)
103
+ controller.update()
104
+ }
105
+
106
+ // Progress Bar
107
+ func setProgressBarProgressColor(hexColor: String) {
108
+ controller.customDayStyle.customProgressBarProgressColor = UIColor(hex: hexColor)
109
+ controller.update()
110
+ }
111
+
112
+ func setProgressBarBackgroundColor(hexColor: String) {
113
+ controller.customDayStyle.customProgressBarBackgroundColor = UIColor(hex: hexColor)
114
+ controller.update()
115
+ }
116
+
117
+ // Instructions Card
118
+ func setInstructionsCardBackgroundColor(hexColor: String) {
119
+ controller.customDayStyle.customInstructionsCardBackgroundColor = UIColor(hex: hexColor)
120
+ controller.update()
121
+ }
122
+
123
+ func setInstructionsCardSeparatorColor(hexColor: String) {
124
+ controller.customDayStyle.customInstructionsCardSeparatorColor = UIColor(hex: hexColor)
125
+ controller.update()
126
+ }
127
+
128
+ func setInstructionsCardHighlightedSeparatorColor(hexColor: String) {
129
+ controller.customDayStyle.customInstructionsCardHighlightedSeparatorColor = UIColor(hex: hexColor)
130
+ controller.update()
131
+ }
132
+
133
+ // Exit View
134
+ func setExitViewForegroundColor(hexColor: String) {
135
+ controller.customDayStyle.customExitViewForegroundColor = UIColor(hex: hexColor)
136
+ controller.update()
137
+ }
138
+
139
+ func setExitViewBorderColor(hexColor: String) {
140
+ controller.customDayStyle.customExitViewBorderColor = UIColor(hex: hexColor)
141
+ controller.update()
142
+ }
143
+
144
+ func setExitViewHighlightColor(hexColor: String) {
145
+ controller.customDayStyle.customExitViewHighlightColor = UIColor(hex: hexColor)
146
+ controller.update()
147
+ }
148
+
149
+ // Route Shield
150
+ func setRouteShieldForegroundColor(hexColor: String) {
151
+ controller.customDayStyle.customRouteShieldForegroundColor = UIColor(hex: hexColor)
152
+ controller.update()
153
+ }
154
+
155
+ func setRouteShieldBorderColor(hexColor: String) {
156
+ controller.customDayStyle.customRouteShieldBorderColor = UIColor(hex: hexColor)
157
+ controller.update()
158
+ }
159
+
160
+ func setRouteShieldHighlightColor(hexColor: String) {
161
+ controller.customDayStyle.customRouteShieldHighlightColor = UIColor(hex: hexColor)
162
+ controller.update()
163
+ }
164
+
165
+ // Distance Labels
166
+ func setDistanceRemainingColor(hexColor: String) {
167
+ controller.customDayStyle.customDistanceRemainingColor = UIColor(hex: hexColor)
168
+ controller.update()
169
+ }
170
+
171
+ func setDistanceUnitColor(hexColor: String) {
172
+ controller.customDayStyle.customDistanceUnitColor = UIColor(hex: hexColor)
173
+ controller.update()
174
+ }
175
+
176
+ func setDistanceValueColor(hexColor: String) {
177
+ controller.customDayStyle.customDistanceValueColor = UIColor(hex: hexColor)
178
+ controller.update()
179
+ }
180
+
181
+ // Navigation Map
182
+ func setRouteAnnotationSelectedColor(hexColor: String) {
183
+ controller.customDayStyle.customRouteAnnotationSelectedColor = UIColor(hex: hexColor)
184
+ controller.update()
185
+ }
186
+
187
+ func setRouteAnnotationColor(hexColor: String) {
188
+ controller.customDayStyle.customRouteAnnotationColor = UIColor(hex: hexColor)
189
+ controller.update()
190
+ }
191
+
192
+ // Route Shield Colors
193
+ func setRoadShieldBlackColor(hexColor: String) {
194
+ controller.customDayStyle.customRoadShieldBlackColor = UIColor(hex: hexColor)
195
+ controller.update()
196
+ }
197
+
198
+ func setRoadShieldBlueColor(hexColor: String) {
199
+ controller.customDayStyle.customRoadShieldBlueColor = UIColor(hex: hexColor)
200
+ controller.update()
201
+ }
202
+
203
+ func setRoadShieldGreenColor(hexColor: String) {
204
+ controller.customDayStyle.customRoadShieldGreenColor = UIColor(hex: hexColor)
205
+ controller.update()
206
+ }
207
+
208
+ func setRoadShieldRedColor(hexColor: String) {
209
+ controller.customDayStyle.customRoadShieldRedColor = UIColor(hex: hexColor)
210
+ controller.update()
211
+ }
212
+
213
+ func setRoadShieldWhiteColor(hexColor: String) {
214
+ controller.customDayStyle.customRoadShieldWhiteColor = UIColor(hex: hexColor)
215
+ controller.update()
216
+ }
217
+
218
+ func setRoadShieldYellowColor(hexColor: String) {
219
+ controller.customDayStyle.customRoadShieldYellowColor = UIColor(hex: hexColor)
220
+ controller.update()
221
+ }
222
+
223
+ func setRoadShieldDefaultColor(hexColor: String) {
224
+ controller.customDayStyle.customRoadShieldDefaultColor = UIColor(hex: hexColor)
225
+ controller.update()
226
+ }
227
+
228
+ // Button Properties
229
+ func setButtonTextColor(hexColor: String) {
230
+ controller.customDayStyle.customButtonTextColor = UIColor(hex: hexColor)
231
+ controller.update()
232
+ }
233
+
234
+ func setCancelButtonTintColor(hexColor: String) {
235
+ controller.customDayStyle.customCancelButtonTintColor = UIColor(hex: hexColor)
236
+ controller.update()
237
+ }
238
+
239
+ func setPreviewButtonTintColor(hexColor: String) {
240
+ controller.customDayStyle.customPreviewButtonTintColor = UIColor(hex: hexColor)
241
+ controller.update()
242
+ }
243
+
244
+ func setStartButtonTintColor(hexColor: String) {
245
+ controller.customDayStyle.customStartButtonTintColor = UIColor(hex: hexColor)
246
+ controller.update()
247
+ }
248
+
249
+ func setDismissButtonBackgroundColor(hexColor: String) {
250
+ controller.customDayStyle.customDismissButtonBackgroundColor = UIColor(hex: hexColor)
251
+ controller.update()
252
+ }
253
+
254
+ func setDismissButtonTextColor(hexColor: String) {
255
+ controller.customDayStyle.customDismissButtonTextColor = UIColor(hex: hexColor)
256
+ controller.update()
257
+ }
258
+
259
+ func setBackButtonBackgroundColor(hexColor: String) {
260
+ controller.customDayStyle.customBackButtonBackgroundColor = UIColor(hex: hexColor)
261
+ controller.update()
262
+ }
263
+
264
+ func setBackButtonTintColor(hexColor: String) {
265
+ controller.customDayStyle.customBackButtonTintColor = UIColor(hex: hexColor)
266
+ controller.update()
267
+ }
268
+
269
+ func setBackButtonTextColor(hexColor: String) {
270
+ controller.customDayStyle.customBackButtonTextColor = UIColor(hex: hexColor)
271
+ controller.update()
272
+ }
273
+
274
+ func setBackButtonBorderColor(hexColor: String) {
275
+ controller.customDayStyle.customBackButtonBorderColor = UIColor(hex: hexColor)
276
+ controller.update()
277
+ }
278
+
279
+ // Navigation View
280
+ func setNavigationViewBackgroundColor(hexColor: String) {
281
+ controller.customDayStyle.customNavigationViewBackgroundColor = UIColor(hex: hexColor)
282
+ controller.update()
283
+ }
284
+
285
+ // Distance Label Properties
286
+ func setDistanceLabelUnitTextColor(hexColor: String) {
287
+ controller.customDayStyle.customDistanceLabelUnitTextColor = UIColor(hex: hexColor)
288
+ controller.update()
289
+ }
290
+
291
+ func setDistanceLabelValueTextColor(hexColor: String) {
292
+ controller.customDayStyle.customDistanceLabelValueTextColor = UIColor(hex: hexColor)
293
+ controller.update()
294
+ }
295
+
296
+ // Rating Control
297
+ func setRatingControlNormalColor(hexColor: String) {
298
+ controller.customDayStyle.customRatingControlNormalColor = UIColor(hex: hexColor)
299
+ controller.update()
300
+ }
301
+
302
+ func setRatingControlSelectedColor(hexColor: String) {
303
+ controller.customDayStyle.customRatingControlSelectedColor = UIColor(hex: hexColor)
304
+ controller.update()
305
+ }
306
+
307
+ // Steps Properties
308
+ func setStepsBackgroundViewColor(hexColor: String) {
309
+ controller.customDayStyle.customStepsBackgroundViewColor = UIColor(hex: hexColor)
310
+ controller.update()
311
+ }
312
+
313
+ func setStepsTableHeaderTintColor(hexColor: String) {
314
+ controller.customDayStyle.customStepsTableHeaderTintColor = UIColor(hex: hexColor)
315
+ controller.update()
316
+ }
317
+
318
+ func setStepsTableHeaderTextColor(hexColor: String) {
319
+ controller.customDayStyle.customStepsTableHeaderTextColor = UIColor(hex: hexColor)
320
+ controller.update()
321
+ }
322
+
323
+ func setStepInstructionsBackgroundColor(hexColor: String) {
324
+ controller.customDayStyle.customStepInstructionsBackgroundColor = UIColor(hex: hexColor)
325
+ controller.update()
326
+ }
327
+
328
+ func setStepTableViewCellBackgroundColor(hexColor: String) {
329
+ controller.customDayStyle.customStepTableViewCellBackgroundColor = UIColor(hex: hexColor)
330
+ controller.update()
331
+ }
332
+
333
+ // Next Instruction
334
+ func setNextInstructionNormalTextColor(hexColor: String) {
335
+ controller.customDayStyle.customNextInstructionNormalTextColor = UIColor(hex: hexColor)
336
+ controller.update()
337
+ }
338
+
339
+ func setNextInstructionContainedTextColor(hexColor: String) {
340
+ controller.customDayStyle.customNextInstructionContainedTextColor = UIColor(hex: hexColor)
341
+ controller.update()
342
+ }
343
+
344
+ // Secondary Label Properties
345
+ func setSecondaryLabelNormalTextColor(hexColor: String) {
346
+ controller.customDayStyle.customSecondaryLabelNormalTextColor = UIColor(hex: hexColor)
347
+ controller.update()
348
+ }
349
+
350
+ // Stylable Label
351
+ func setStylableLabelNormalTextColor(hexColor: String) {
352
+ controller.customDayStyle.customStylableLabelNormalTextColor = UIColor(hex: hexColor)
353
+ controller.update()
354
+ }
355
+
356
+ // CarPlay Properties
357
+ func setCarPlayCompassBackgroundColor(hexColor: String) {
358
+ controller.customDayStyle.customCarPlayCompassBackgroundColor = UIColor(hex: hexColor)
359
+ controller.update()
360
+ }
37
361
  }
38
362
 
39
363
 
@@ -344,23 +668,13 @@ class ExpoMapboxNavigationViewController: UIViewController {
344
668
  update()
345
669
  }
346
670
 
347
- func setManeuverViewPrimaryColor(hexColor: String) {
348
- customDayStyle.customManeuverViewPrimaryColor = UIColor(hex: hexColor)
349
- update()
350
- }
351
-
352
- func setManeuverViewSecondaryColor(hexColor: String) {
353
- customDayStyle.customManeuverViewSecondaryColor = UIColor(hex: hexColor)
354
- update()
355
- }
356
-
357
- func setManeuverViewTextColor(hexColor: String) {
358
- customDayStyle.customManeuverViewTextColor = UIColor(hex: hexColor)
671
+ func setManeuverViewPrimaryColorHighlighted(hexColor: String) {
672
+ customDayStyle.customManeuverViewPrimaryColorHighlighted = UIColor(hex: hexColor)
359
673
  update()
360
674
  }
361
675
 
362
- func setManeuverViewBackgroundColor(hexColor: String) {
363
- customDayStyle.customManeuverViewBackgroundColor = UIColor(hex: hexColor)
676
+ func setManeuverViewSecondaryColorHighlighted(hexColor: String) {
677
+ customDayStyle.customManeuverViewSecondaryColorHighlighted = UIColor(hex: hexColor)
364
678
  update()
365
679
  }
366
680
 
@@ -396,7 +710,7 @@ class ExpoMapboxNavigationViewController: UIViewController {
396
710
  calculateRoutesTask = Task {
397
711
  switch await self.routingProvider!.calculateRoutes(options: routeOptions).result {
398
712
  case .failure(let error):
399
- print(error.localizedDescription)
713
+ print("Route calculation failed: \(error.localizedDescription)")
400
714
  case .success(let navigationRoutes):
401
715
  onRoutesCalculated(navigationRoutes: navigationRoutes)
402
716
  }
@@ -416,7 +730,7 @@ class ExpoMapboxNavigationViewController: UIViewController {
416
730
  calculateRoutesTask = Task {
417
731
  switch await self.routingProvider!.calculateRoutes(options: matchOptions).result {
418
732
  case .failure(let error):
419
- print(error.localizedDescription)
733
+ print("Map matching failed: \(error.localizedDescription)")
420
734
  case .success(let navigationRoutes):
421
735
  onRoutesCalculated(navigationRoutes: navigationRoutes)
422
736
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complexify/expo-mapbox-navigation",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "Expo module for Mapbox's Navigation SDK",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { ViewStyle, StyleProp } from "react-native";
1
+ import { ViewStyle, StyleProp } from "react-native/types";
2
2
 
3
3
  type ProgressEvent = {
4
4
  distanceRemaining: number;
@@ -68,14 +68,134 @@ export type ExpoMapboxNavigationViewProps = {
68
68
 
69
69
  // Way Name Label (8)
70
70
  wayNameViewBackgroundColor?: string;
71
+ wayNameViewTextColor?: string;
71
72
 
72
- // Maneuver View (Direction Arrow and Text)
73
- maneuverViewPrimaryColor?: string; // Main arrow color
74
- maneuverViewSecondaryColor?: string; // Secondary arrow color
75
- maneuverViewTextColor?: string; // Direction text color
76
- maneuverViewBackgroundColor?: string; // Background of the direction bar
73
+ // Steps List
74
+ stepsBackgroundColor?: string;
75
+ stepsPrimaryTextColor?: string;
76
+ stepsSecondaryTextColor?: string;
77
+ stepsManeuverViewPrimaryColor?: string;
78
+ stepsManeuverViewSecondaryColor?: string;
79
+ stepsSeparatorColor?: string;
80
+
81
+ // Lane View
82
+ laneViewBackgroundColor?: string;
83
+ laneViewForegroundColor?: string;
84
+ laneViewSeparatorColor?: string;
85
+
86
+ // Next Banner View
87
+ nextBannerBackgroundColor?: string;
88
+ nextBannerPrimaryTextColor?: string;
89
+ nextBannerSecondaryTextColor?: string;
90
+ nextBannerDistanceTextColor?: string;
91
+
92
+ // Progress Bar
93
+ progressBarProgressColor?: string;
94
+ progressBarBackgroundColor?: string;
95
+
96
+ // Maneuver View (Direction Arrow)
97
+ maneuverViewPrimaryColor?: string;
98
+ maneuverViewSecondaryColor?: string;
99
+ maneuverViewPrimaryColorHighlighted?: string;
100
+ maneuverViewSecondaryColorHighlighted?: string;
77
101
 
78
102
  // Instructions View
79
103
  instructionsTextColor?: string; // Color for all instruction text
80
104
  instructionsBackgroundColor?: string; // Background color for instruction panels
105
+
106
+ // Instructions Card
107
+ instructionsCardBackgroundColor?: string;
108
+ instructionsCardSeparatorColor?: string;
109
+ instructionsCardHighlightedSeparatorColor?: string;
110
+
111
+ // Exit View
112
+ exitViewForegroundColor?: string;
113
+ exitViewBorderColor?: string;
114
+ exitViewHighlightColor?: string;
115
+
116
+ // Route Shield
117
+ routeShieldForegroundColor?: string;
118
+ routeShieldBorderColor?: string;
119
+ routeShieldHighlightColor?: string;
120
+
121
+ // Distance Labels
122
+ distanceRemainingColor?: string;
123
+ distanceUnitColor?: string;
124
+ distanceValueColor?: string;
125
+
126
+ // Navigation Map
127
+ routeAnnotationSelectedColor?: string;
128
+ routeAnnotationColor?: string;
129
+ routeAnnotationTextColor?: string;
130
+ routeAnnotationSelectedTextColor?: string;
131
+ routeAnnotationMoreTimeTextColor?: string;
132
+ routeAnnotationLessTimeTextColor?: string;
133
+ waypointColor?: string;
134
+ waypointStrokeColor?: string;
135
+
136
+ // Feedback
137
+ feedbackBackgroundColor?: string;
138
+ feedbackTextColor?: string;
139
+ feedbackCellColor?: string;
140
+ feedbackSubtypeCircleColor?: string;
141
+ feedbackSubtypeCircleOutlineColor?: string;
142
+
143
+ // End of Route
144
+ endOfRouteButtonTextColor?: string;
145
+ endOfRouteCommentBackgroundColor?: string;
146
+ endOfRouteCommentTextColor?: string;
147
+ endOfRouteContentBackgroundColor?: string;
148
+ endOfRouteTitleTextColor?: string;
149
+
150
+ // Road Shield Colors
151
+ roadShieldBlackColor?: string;
152
+ roadShieldBlueColor?: string;
153
+ roadShieldGreenColor?: string;
154
+ roadShieldRedColor?: string;
155
+ roadShieldWhiteColor?: string;
156
+ roadShieldYellowColor?: string;
157
+ roadShieldDefaultColor?: string;
158
+
159
+ // Button Properties
160
+ buttonTextColor?: string;
161
+ cancelButtonTintColor?: string;
162
+ previewButtonTintColor?: string;
163
+ startButtonTintColor?: string;
164
+ dismissButtonBackgroundColor?: string;
165
+ dismissButtonTextColor?: string;
166
+ backButtonBackgroundColor?: string;
167
+ backButtonTintColor?: string;
168
+ backButtonTextColor?: string;
169
+ backButtonBorderColor?: string;
170
+
171
+ // Navigation View
172
+ navigationViewBackgroundColor?: string;
173
+
174
+ // Distance Label Properties
175
+ distanceLabelUnitTextColor?: string;
176
+ distanceLabelValueTextColor?: string;
177
+
178
+ // Rating Control
179
+ ratingControlNormalColor?: string;
180
+ ratingControlSelectedColor?: string;
181
+
182
+ // Steps Properties
183
+ stepsBackgroundViewColor?: string;
184
+ stepsTableHeaderTintColor?: string;
185
+ stepsTableHeaderTextColor?: string;
186
+ stepInstructionsBackgroundColor?: string;
187
+ stepTableViewCellBackgroundColor?: string;
188
+
189
+ // Next Instruction
190
+ nextInstructionNormalTextColor?: string;
191
+ nextInstructionContainedTextColor?: string;
192
+
193
+ // Secondary Label Properties
194
+ secondaryLabelNormalTextColor?: string;
195
+
196
+ // Stylable Label
197
+ stylableLabelNormalTextColor?: string;
198
+
199
+ // CarPlay Properties
200
+ carPlayCompassBackgroundColor?: string;
81
201
  };