use of net.osmand.plus.mapmarkers.MapMarkerSelectionFragment in project Osmand by osmandapp.
the class MapRouteInfoMenu method selectMapMarker.
public void selectMapMarker(final int index, final boolean target, final boolean intermediate) {
if (index != -1) {
MapMarker m = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers().get(index);
LatLon point = new LatLon(m.getLatitude(), m.getLongitude());
if (intermediate) {
getTargets().navigateToPoint(point, true, getTargets().getIntermediatePoints().size(), m.getPointDescription(mapActivity));
} else if (target) {
getTargets().navigateToPoint(point, true, -1, m.getPointDescription(mapActivity));
} else {
getTargets().setStartPoint(point, true, m.getPointDescription(mapActivity));
}
updateFromIcon();
} else {
MapMarkerSelectionFragment selectionFragment = MapMarkerSelectionFragment.newInstance(target, intermediate);
selectionFragment.show(mapActivity.getSupportFragmentManager(), MapMarkerSelectionFragment.TAG);
}
}
Aggregations