Skip to content

Commit

Permalink
Nearby: Fix race condition and lag when loading pin details, faster o…
Browse files Browse the repository at this point in the history
…verlay management (#6047)

* temporary fixes part one

* temporary fixes part two

* temporary fixes part three

* temporary fixes part four

* temporary fixes part five

* reformatting

* remove code no longer in use

* Migrate NearbyParentFragmentPresenter to Kotlin

* Partially replace temporary experimental fixes

* Replace temporary experimental fixes part 2

* Replace temporary experimental fixes part 3

* Replace temporary fixes completely

* Fix caching and loading places in Nearby list

* Add place bookmarking logic, Remove all old code

* Nearby Presenter: Close channel properly

* Nearby pins now load starting from the center

Fixes #6049

* Add comments and javadoc for Nearby Presenter

* Fix warnings, Fix formatting, Add javadoc

* Pass unit tests
  • Loading branch information
savsch authored Dec 20, 2024
1 parent 70b4f78 commit c891c2b
Show file tree
Hide file tree
Showing 6 changed files with 676 additions and 679 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

public class NearbyController extends MapController {

private static final int MAX_RESULTS = 1000;
private final NearbyPlaces nearbyPlaces;
public static final int MAX_RESULTS = 1000;
public static double currentLocationSearchRadius = 10.0; //in kilometers
public static LatLng currentLocation; // Users latest fetched location
public static LatLng latestSearchLocation; // Can be current and camera target on search this area button is used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import android.content.Context;
import androidx.annotation.Nullable;
import androidx.lifecycle.LifecycleCoroutineScope;
import fr.free.nrw.commons.BaseMarker;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
import fr.free.nrw.commons.nearby.Label;
import fr.free.nrw.commons.nearby.MarkerPlaceGroup;
import fr.free.nrw.commons.nearby.Place;
import java.util.List;

Expand Down Expand Up @@ -68,7 +70,7 @@ interface View {

Context getContext();

void updateMapMarkers(List<BaseMarker> BaseMarkers);
void replaceMarkerOverlays(List<MarkerPlaceGroup> markerPlaceGroups);

void filterOutAllMarkers();

Expand Down Expand Up @@ -127,5 +129,7 @@ void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterFor
void setCheckboxUnknown();

void setAdvancedQuery(String query);

void toggleBookmarkedStatus(Place place);
}
}
Loading

0 comments on commit c891c2b

Please sign in to comment.