mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
ExploreMapFragment.java: fix performMapReadyActions to center to user's last known location
Before this commit, fixing a previous bug caused performMapReadyActions to center the map on a default location rather than the available last known location. This commit adds code which will attempt to get the last known user location. If it cannot be retrieved, the default location is used. The map now centers properly.
This commit is contained in:
parent
df8585d877
commit
a6b0ecc0b2
1 changed files with 6 additions and 1 deletions
|
|
@ -340,7 +340,12 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment
|
|||
!locationPermissionsHelper.checkLocationPermission(getActivity())) {
|
||||
isPermissionDenied = true;
|
||||
}
|
||||
lastKnownLocation = MapUtils.getDefaultLatLng();
|
||||
|
||||
lastKnownLocation = getLastLocation();
|
||||
|
||||
if (lastKnownLocation == null) {
|
||||
lastKnownLocation = MapUtils.getDefaultLatLng();
|
||||
}
|
||||
|
||||
// if we came from 'Show in Explore' in Nearby, load Nearby map center and zoom
|
||||
if (isCameFromNearbyMap()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue