@@ -403,16 +403,27 @@ private void createWaypoint(Map map) {
403403 }
404404
405405 @ ReactMethod
406- public void setDestination (ReadableMap waypoint , @ Nullable ReadableMap routingOptions ) {
406+ public void setDestination (
407+ ReadableMap waypoint ,
408+ @ Nullable ReadableMap routingOptions ,
409+ @ Nullable ReadableMap displayOptions ) {
407410 pendingRoute = null ; // reset pendingRoute.
408411 mWaypoints .clear (); // reset waypoints
409412 createWaypoint (waypoint .toHashMap ());
410413
411414 if (routingOptions != null ) {
412- pendingRoute =
413- mNavigator .setDestination (
414- mWaypoints .get (0 ),
415- ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()));
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+ }
416427 } else {
417428 pendingRoute = mNavigator .setDestination (mWaypoints .get (0 ));
418429 }
@@ -427,7 +438,10 @@ public void onResult(Navigator.RouteStatus code) {
427438 }
428439
429440 @ ReactMethod
430- public void setDestinations (ReadableArray waypoints , @ Nullable ReadableMap routingOptions ) {
441+ public void setDestinations (
442+ ReadableArray waypoints ,
443+ @ Nullable ReadableMap routingOptions ,
444+ @ Nullable ReadableMap displayOptions ) {
431445 if (mNavigator == null ) {
432446 // TODO: HANDLE THIS
433447 return ;
@@ -443,10 +457,18 @@ public void setDestinations(ReadableArray waypoints, @Nullable ReadableMap routi
443457 }
444458
445459 if (routingOptions != null ) {
446- pendingRoute =
447- mNavigator .setDestinations (
448- mWaypoints ,
449- ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()));
460+ if (displayOptions != null ) {
461+ pendingRoute =
462+ mNavigator .setDestinations (
463+ mWaypoints ,
464+ ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()),
465+ ObjectTranslationUtil .getDisplayOptionsFromMap (displayOptions .toHashMap ()));
466+ } else {
467+ pendingRoute =
468+ mNavigator .setDestinations (
469+ mWaypoints ,
470+ ObjectTranslationUtil .getRoutingOptionsFromMap (routingOptions .toHashMap ()));
471+ }
450472 } else {
451473 pendingRoute = mNavigator .setDestinations (mWaypoints );
452474 }
0 commit comments