Closed shahraizali closed 3 years ago
I haven't implemented a callback for that yet and on iOS I chose to manually hide it for now. I think in a future release I'd like to add an onCancel
prop that will get triggered when you click that "X" to stop navigation. I will also need to add an imperative way for you to cancel navigation via the MapboxNavigation
react ref.
Here is the stubbed in listener on android - https://github.com/homeeondemand/react-native-mapbox-navigation/blob/master/android/src/main/java/com/homee/mapboxnavigation/MapboxNavigationView.kt#L164
I'll leave this thread opened until this is implemented.
Hey! @rossmartin Created a PR for onCancelNavigation
. it has fulfilled my requirement I am able to do this now
<MapboxNavigation
onError={(event) => { const { message } = event.nativeEvent; }}
onCancelNavigation={(event)=>{ #HERE PERFORM MY ACTION }}>
</MapboxNavigation>
NOTE: I am not a Native developer so If there is something wrong with my implementation kindly do point it out. Thank You.
Hey thank you for the contribution. I'd like to get this added in for iOS as well before releasing the next version. I'll either add onto your PR or merge it and add this for iOS separately. I should have some time this weekend.
sounds good on a separate note any plan on adding theme specification like light or dark?
I wasn't planning on it yet but you should be able to customize the day and night theme on android - https://docs.mapbox.com/android/navigation/guides/styles/
The library should be changing to night mode automatically when necessary.
I had time tonight so I merged #5, implemented onCancelNavigation
for iOS, and documented it. This is all in 0.2.0
.
Thanks again.
Perfect! as for the colors I wanted to change the blue header of turn by turn nav. I know the map is adaptive of local dark mode but the header color I wanted to make it white couldn't figure out how to go about that.
@shahraizali are you able to change the blue header of turn by turn nav?
Some news about this topic? i want to change nav color too
how to get an event by clicking on that cross or is there any other way of closing it?
Thank You