File tree Expand file tree Collapse file tree 1 file changed +3
-28
lines changed
android/src/main/java/com/google/android/react/navsdk Expand file tree Collapse file tree 1 file changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -407,34 +407,9 @@ public void setDestination(
407407 ReadableMap waypoint ,
408408 @ Nullable ReadableMap routingOptions ,
409409 @ Nullable ReadableMap displayOptions ) {
410- pendingRoute = null ; // reset pendingRoute.
411- mWaypoints .clear (); // reset waypoints
412- createWaypoint (waypoint .toHashMap ());
413-
414- if (routingOptions != null ) {
415- if (displayOptions != null ) {
416- pendingRoute =
417- mNavigator .setDestination (
418- mWaypoints .get (0 ),
419- ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()),
420- ObjectTranslationUtil .getDisplayOptionsFromMap (displayOptions .toHashMap ()));
421- } else {
422- pendingRoute =
423- mNavigator .setDestination (
424- mWaypoints .get (0 ),
425- ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()));
426- }
427- } else {
428- pendingRoute = mNavigator .setDestination (mWaypoints .get (0 ));
429- }
430-
431- setOnResultListener (
432- new IRouteStatusResult () {
433- @ Override
434- public void onResult (Navigator .RouteStatus code ) {
435- sendCommandToReactNative ("onRouteStatusResult" , code .toString ());
436- }
437- });
410+ WritableArray array = new WritableNativeArray ();
411+ array .pushMap (waypoint );
412+ setDestinations (array , routingOptions , displayOptions );
438413 }
439414
440415 @ ReactMethod
You can’t perform that action at this time.
0 commit comments