我们正在将 Android Project Here Map Android Starter SDK转换为Lite Edition。我想在路线上显示多个航点。
对于 Starter SDK,我们使用RoutePlan来绘制多个航点。但在精简版中,我无法找到 RoutePlan。有关更多信息,请查找以下 Android Starter SDK代码片段:
val routePlan = RoutePlan()
val routeOptions = RouteOptions()
routeOptions.transportMode = RouteOptions.TransportMode.CAR
routeOptions.routeType = RouteOptions.Type.FASTEST
routePlan.routeOptions = routeOptions
for (routeLatLang in tripRouteData) {
try {
routePlan.addWaypoint(GeoCoordinate(lat.toDouble(), longg.toDouble()))
} catch (e: Exception) {
e.printStackTrace()
}
}
val error = routeManager.calculateRoute(routePlan, routeManagerListener)
if (error != RouteManager.Error.NONE) {
Toast.makeText(activity,
"Route calculation failed with: " + error.toString(), Toast.LENGTH_SHORT)
.show()
}
还可以找到以下Lite Edition SDK 的代码片段:
val waypoint1 = Waypoint(latitude1,longitude1)
val waypoint2 = Waypoint(latitude2,longitude2)
val waypoints = java.util.ArrayList(Arrays.asList(Waypoint(startGeoCoordinates),
waypoint1, waypoint2, Waypoint(destinationGeoCoordinates)))
那么,我们如何在 Here Map Lite Edition上绘制多个航点,以及在路线上绘制的最大航点的限制是什么。