diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java index 4f777aeb4..e8d32fa4a 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java @@ -38,6 +38,7 @@ public class NearbyController { this.prefs = prefs; } + /** * Prepares Place list to make their distance information update later. * @@ -45,7 +46,7 @@ public class NearbyController { * @return NearbyPlacesInfo a variable holds Place list without distance information * and boundary coordinates of current Place List */ - public NearbyPlacesInfo loadAttractionsFromLocation(LatLng curLatLng) throws IOException { + public NearbyPlacesInfo loadAttractionsFromLocation(LatLng curLatLng, boolean returnClosestResult) throws IOException { Timber.d("Loading attractions near %s", curLatLng); NearbyPlacesInfo nearbyPlacesInfo = new NearbyPlacesInfo(); @@ -53,7 +54,7 @@ public class NearbyController { if (curLatLng == null) { return null; } - List places = nearbyPlaces.getFromWikidataQuery(curLatLng, Locale.getDefault().getLanguage()); + List places = nearbyPlaces.getFromWikidataQuery(curLatLng, Locale.getDefault().getLanguage(), returnClosestResult); if (null != places && places.size() > 0) { LatLng[] boundaryCoordinates = {places.get(0).location, // south @@ -162,7 +163,7 @@ public class NearbyController { } public class NearbyPlacesInfo { - List placeList; // List of nearby places - LatLng[] boundaryCoordinates; // Corners of nearby area + public List placeList; // List of nearby places + public LatLng[] boundaryCoordinates; // Corners of nearby area } }