react-native-mapbox-navigation icon indicating copy to clipboard operation
react-native-mapbox-navigation copied to clipboard

How to change the destination while in progress

Open squareborg opened this issue 3 years ago • 3 comments

Hey does anybody know how to change the destination while its currently navigating a destination. It appears swapping out the destination prop does not change the destination.

squareborg avatar Feb 02 '22 07:02 squareborg

@squareborg the way i am using it is to wrap the navigator in a view under state isInRide when a new destination comes in then I setIsInRide(false) update the coords for destination and then setIsInRide(true) to reinitialise the navigator. I wish to see an integrated method in this as well

zoolle avatar Feb 02 '22 10:02 zoolle

@zoolle Perfect, yeah I was thinking this would be something of a last resort if nothing existed, I just tested it and it does reload now. Thanks

squareborg avatar Feb 03 '22 12:02 squareborg

@zoolle Could you share a sample code? I tried it but every time I restart the navigator the app just closes without any error message.

Artotim avatar Feb 10 '22 03:02 Artotim