Route requests with waypoints
This guide explains how to request a route with waypoints. requestRouteWithWaypoints() requests a route with a final destination and one or more waypoints. Configure the destination with RouteInfo and the waypoints with RequestWaypointInfo, then pass both to RouteWithWaypointsRequest.
Requesting a route with waypoints
- Kotlin
- Java
naviHelper.requestRouteWithWaypoints(
RouteWithWaypointsRequest(
destination = RouteInfo(
latitude = 37.48544722,
longitude = 127.03636666,
poiName = "42dot",
poiId = "36khp37hh8gqcm5nqhe5",
address = "2621 Nambusunhwan-ro, Gangnam-gu, Seoul",
poiSubId = "0"
),
waypoints = listOf(
RequestWaypointInfo(
latitude = 37.41275833,
longitude = 127.09481944,
poiName = "Pangyo Hyundai Department Store",
waypointIndex = WaypointIndex.FIRST,
poiId = "36khp2hdj2cfcm5nqhe3",
address = "6 Changup-ro 0beon-gil, Sujeong-gu, Seongnam-si, Gyeonggi-do",
poiSubId = "0"
)
)
)
)
import java.util.Arrays;
naviHelper.requestRouteWithWaypoints(new RouteWithWaypointsRequest(
new RouteInfo(
37.48544722,
127.03636666,
null,
null,
"42dot",
"36khp37hh8gqcm5nqhe5",
"2621 Nambusunhwan-ro, Gangnam-gu, Seoul",
"0"
),
Arrays.asList(new RequestWaypointInfo(
37.41275833,
127.09481944,
"Pangyo Hyundai Department Store",
WaypointIndex.FIRST,
"36khp2hdj2cfcm5nqhe3",
"6 Changup-ro 0beon-gil, Sujeong-gu, Seongnam-si, Gyeonggi-do",
"0"
))
));
requestRouteWithWaypoints() requires the pleos.car.permission.NAVI_ROUTE_SEARCH permission. Check the route request result through events such as onRouteStarted, onRoutingCompleted, and onError on the registered NaviHelperEventListener.
Related APIs: requestRouteWithWaypoints, RouteWithWaypointsRequest, RouteInfo, RequestWaypointInfo