use of com.mapbox.services.commons.geojson.Feature in project mapbox-navigation-android by mapbox.
the class NavigationMapRoute method addTrafficToSource.
/**
* If the {@link DirectionsRoute} request contains congestion information via annotations, breakup
* the source into pieces so data-driven styling can be used to change the route colors
* accordingly.
*/
private FeatureCollection addTrafficToSource(DirectionsRoute route, int index) {
final List<Feature> features = new ArrayList<>();
LineString originalGeometry = LineString.fromPolyline(route.geometry(), Constants.PRECISION_6);
buildRouteFeatureFromGeometry(index, features, originalGeometry);
routeLineStrings.put(originalGeometry, route);
LineString lineString = LineString.fromPolyline(route.geometry(), Constants.PRECISION_6);
buildTrafficFeaturesFromRoute(route, index, features, lineString);
return FeatureCollection.fromFeatures(features);
}
Aggregations