Search in sources :

Example 1 with WayMarkerOptions

use of io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions 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)

Example 2 with WayMarkerOptions

use of io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions in project osm-contributor by jawg.

the class MapFragment method clearAllNodeRef.

private void clearAllNodeRef() {
    for (WayMarkerOptions locationMarker : markersNodeRef.values()) {
        removeWayMarker(locationMarker);
    }
    for (PolylineOptions polylineOptions : polylinesWays.values()) {
        removePolyline(polylineOptions);
    }
    markersNodeRef.clear();
    polylinesWays.clear();
}
Also used : WayMarkerOptions(io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions) PolylineOptions(com.mapbox.mapboxsdk.annotations.PolylineOptions)

Aggregations

WayMarkerOptions (io.jawg.osmcontributor.ui.utils.views.map.marker.WayMarkerOptions)2 PolylineOptions (com.mapbox.mapboxsdk.annotations.PolylineOptions)1 PoiNodeRef (io.jawg.osmcontributor.model.entities.PoiNodeRef)1 Way (io.jawg.osmcontributor.model.entities.Way)1