Search in sources :

Example 1 with PathLayer

use of org.oscim.layers.vector.PathLayer in project graphhopper by graphhopper.

the class MainActivity method createPathLayer.

private PathLayer createPathLayer(PathWrapper response) {
    Style style = Style.builder().generalization(Style.GENERALIZATION_SMALL).strokeColor(0x9900cc33).strokeWidth(4 * getResources().getDisplayMetrics().density).build();
    PathLayer pathLayer = new PathLayer(mapView.map(), style);
    List<GeoPoint> geoPoints = new ArrayList<>();
    PointList pointList = response.getPoints();
    for (int i = 0; i < pointList.getSize(); i++) geoPoints.add(new GeoPoint(pointList.getLatitude(i), pointList.getLongitude(i)));
    pathLayer.setPoints(geoPoints);
    return pathLayer;
}
Also used : PathLayer(org.oscim.layers.vector.PathLayer) GeoPoint(org.oscim.core.GeoPoint) PointList(com.graphhopper.util.PointList) ArrayList(java.util.ArrayList) Style(org.oscim.layers.vector.geometries.Style) GeoPoint(org.oscim.core.GeoPoint)

Aggregations

PointList (com.graphhopper.util.PointList)1 ArrayList (java.util.ArrayList)1 GeoPoint (org.oscim.core.GeoPoint)1 PathLayer (org.oscim.layers.vector.PathLayer)1 Style (org.oscim.layers.vector.geometries.Style)1