Search in sources :

Example 1 with Way

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;
}
Also used : Poi(io.jawg.osmcontributor.model.entities.Poi) PoiNodeRef(io.jawg.osmcontributor.model.entities.PoiNodeRef) Way(io.jawg.osmcontributor.model.entities.Way) HashSet(java.util.HashSet)

Example 2 with Way

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());
        }
    }
}
Also used : WayMarkerOptions(io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions) PoiNodeRef(io.jawg.osmcontributor.model.entities.PoiNodeRef) Way(io.jawg.osmcontributor.model.entities.Way)

Aggregations

PoiNodeRef (io.jawg.osmcontributor.model.entities.PoiNodeRef)2 Way (io.jawg.osmcontributor.model.entities.Way)2 Poi (io.jawg.osmcontributor.model.entities.Poi)1 WayMarkerOptions (io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions)1 HashSet (java.util.HashSet)1