Skip to main content

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​

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"
)
)
)
)

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