use of com.mapbox.api.directions.v5.models.RouteLeg in project mapbox-navigation-android by mapbox.
the class NavigationMapRoute method waypointFeatureCollection.
/**
* The routes also display an icon for each waypoint in the route, we use symbol layers for this.
*/
private static FeatureCollection waypointFeatureCollection(DirectionsRoute route) {
final List<Feature> waypointFeatures = new ArrayList<>();
for (RouteLeg leg : route.legs()) {
waypointFeatures.add(getPointFromLineString(leg, 0));
waypointFeatures.add(getPointFromLineString(leg, leg.steps().size() - 1));
}
return FeatureCollection.fromFeatures(waypointFeatures);
}
Aggregations