use of net.osmand.plus.mapmarkers.OrderByBottomSheetDialogFragment.OrderByFragmentListener in project Osmand by osmandapp.
the class MapMarkersDialogFragment method createOrderByFragmentListener.
private OrderByFragmentListener createOrderByFragmentListener() {
return new OrderByFragmentListener() {
@Override
public void onMapMarkersOrderByModeChanged(@MapMarkersSortByDef int sortByMode) {
OsmandApplication app = getMyApplication();
MapActivity mapActivity = getMapActivity();
Location location = app.getLocationProvider().getLastKnownLocation();
boolean useCenter = !(mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation() && location != null);
LatLon loc = useCenter ? mapActivity.getMapLocation() : new LatLon(location.getLatitude(), location.getLongitude());
app.getMapMarkersHelper().sortMarkers(sortByMode, loc);
activeFragment.updateAdapter();
}
};
}
Aggregations