use of io.jawg.osmcontributor.model.entities.Way in project osm-contributor by jawg.
the class WayMapper method poisToWays.
public static Set<Way> poisToWays(List<Poi> pois) {
Set<Way> ways = new HashSet<>();
if (pois != null && !pois.isEmpty()) {
for (Poi poi : pois) {
Way way = new Way(poi);
for (PoiNodeRef nodeRef : poi.getNodeRefs()) {
// Properties of a node in way edition
way.add(nodeRef);
}
ways.add(way);
}
}
return ways;
}
use of io.jawg.osmcontributor.model.entities.Way in project osm-contributor by jawg.
the class MapFragment method updateVectorials.
public void updateVectorials(Set<Way> ways, TreeSet<Double> levels) {
for (Way way : ways) {
mapboxMap.addPolyline(way.getPolylineOptions());
for (PoiNodeRef poiNodeRef : way.getPoiNodeRefs()) {
WayMarkerOptions wayMarkerOptions = new WayMarkerOptions().position(poiNodeRef.getPosition()).poiNodeRef(poiNodeRef).icon(IconFactory.getInstance(getActivity()).fromBitmap(bitmapHandler.getNodeRefBitmap(PoiNodeRef.State.NONE)));
addWayMarker(wayMarkerOptions);
markersNodeRef.put(poiNodeRef.getId(), wayMarkerOptions);
polylinesWays.put(poiNodeRef.getId(), way.getPolylineOptions());
}
}
}
Aggregations