Destinations
Use NaviHelper APIs to set, check, and cancel a destination. Confirm the results in NaviHelperEventListener callbacks.
Set, check, and cancel a destination
Call requestRoute() to set a destination, getDestinationInfo() to check it, and cancelRoute() to cancel it. To set the destination again, call requestRoute() again.
- Kotlin
- Java
// Set destination
naviHelper.requestRoute(
RouteInfo(
latitude = 37.48544722,
longitude = 127.03636666,
displayLongitude = null,
displayLatitude = null,
poiName = "42dot",
poiId = "36khp37hh8gqcm5nqhe5",
poiSubId = "0",
address = "서울시 강남구 남부순환로 2621"
)
)
// Check destination
naviHelper.getDestinationInfo()
// Receive data in the onDestinationInfo callback
override fun onDestinationInfo(destinationInfo: DestinationInfo) {
Log.d(logTag, "onDestinationInfo $destinationInfo")
}
// Cancel destination
naviHelper.cancelRoute()
// Set destination
naviHelper.requestRoute(new RouteInfo(
127.03636666,
37.48544722,
null,
null,
"42dot",
"36khp37hh8gqcm5nqhe5",
"서울시 강남구 남부순환로 2621",
"0",
RouteOption.RECOMMENDED
));
// Check destination
naviHelper.getDestinationInfo();
// Receive data in the onDestinationInfo callback
@Override
public void onDestinationInfo(DestinationInfo destinationInfo) {
Log.d(logTag, "onDestinationInfo = " + destinationInfo);
}
// Cancel destination
naviHelper.cancelRoute();
You can monitor the route search process with the following callbacks.
| Callback | Description |
|---|---|
onRouteStarted(routeStartInfo) | Called when the Navigation app starts a route search. |
onRoutingCompleted() | Called when the route search is complete. |
onDestinationChanged() | Called when a destination is set or removed. |
onError(errorCode) | Called when an error occurs while processing a route request. |
note
A successful call to requestRoute() does not mean the route search is complete. Confirm the final result in event callbacks. Information query APIs do not return values directly; process the result in the corresponding event callback.
For route option changes and rerouting, see Routes.