mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Search this area (#2051)
* Recognize user is moving on the map and show a button * Use variable from strings xml instead of hardcoded string * Change search this area button location in xml file * Add location util file to convert mapbox LatLng to commons Latlng and viceversa * Populate places around searched area * Update narby map according to new points came from searched area * Add searchThisAreaMode boolean to stop nearby map updated when we try to search nearby areas. * Lock auto nearby operations during serch this area mode, with a more modular method and decrease code repetition * Add an if clausse to prevent multiple refresh view calls, while map is moving * Disable map gestures during search this area operation, re-eable them on operation is done * Add progress bar during search this area operation * Make sure you locked the map during search nearby map process * Implement recenter map view button * Fix logic problem and make sure you refreshed the view on coming back to previous position * Use custom refresh method instead * Use latest updated location from location manager isntead * Update ListFragment accordingly too * Do not update camera target according to bottom sheet status or do not follow users location with camera, if search this area mode is on * Add javadocs, sorry forgotten previously * Remove unused method * Threat both or search this area and regular search in same way * Make sure distances are correct * Seperate cutom location updates and current location updates from each other to continue other operations * Remove all logs, and make sure search this are button is not visible for no reason while around of current location is already loaded * Notify load attractions from location method about search status, current location of custom location * Make sure we calculate searched area and display search this area button when we are out of 3/4 of total searched area
This commit is contained in:
parent
b907a0a8f1
commit
677e0099af
9 changed files with 283 additions and 32 deletions
|
|
@ -0,0 +1,13 @@
|
|||
package fr.free.nrw.commons.utils;
|
||||
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
|
||||
public class LocationUtils {
|
||||
public static LatLng mapBoxLatLngToCommonsLatLng(com.mapbox.mapboxsdk.geometry.LatLng mapBoxLatLng) {
|
||||
return new LatLng(mapBoxLatLng.getLatitude(), mapBoxLatLng.getLongitude(), 0);
|
||||
}
|
||||
|
||||
public static com.mapbox.mapboxsdk.geometry.LatLng comonsLatLngToMapBoxLatLng(LatLng commonsLatLng) {
|
||||
return new com.mapbox.mapboxsdk.geometry.LatLng(commonsLatLng.getLatitude(), commonsLatLng.getLongitude());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue