androidhere-apimaproute

Android HERE: How to draw part of route


I have calculated route for 10 waypoints. If i simply create new MapRoute it will draw full route from first to last waypoint. Is it possible to draw part of route, from first to second waypoint? I use 3.4.0.165 HERE SDK version. I have found this answer, but it for previous version.

I have tried to draw only first subleg in this way:

    int duration = route.getTta(Route.TrafficPenaltyMode.AVOID_LONG_TERM_CLOSURES, 0).getDuration();
    RouteElements routeElementsFromDuration = route.getRouteElementsFromDuration(0, duration);
    MapPolyline mapPolyline = new MapPolyline(routeElementsFromDuration.getGeometry());
    map.addMapObject(mapPolyline);

But when map tilt enabled polyline drawn somewhere above roads, and if i change scale polyline change position relative to map tile objects.


Solution

  • Currently it is not possible, workaround - calculate route between each point and draw required part.