mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
LocationPickerActivity.java: Fix location picker bug with incorrect map centering (#5716)
This commit moves the center of the map to the image's location, if the image has location EXIF data. If the image does not have location EXIF data, the map will center on the device's current GPS location.
This commit is contained in:
parent
bb4cfe421a
commit
3dc7180784
1 changed files with 10 additions and 0 deletions
|
|
@ -237,6 +237,16 @@ public class LocationPickerActivity extends BaseActivity implements
|
|||
cameraPosition.getLongitude()));
|
||||
}
|
||||
setupMapView();
|
||||
|
||||
if("UploadActivity".equals(activity)){
|
||||
if(mapView != null && mapView.getController() != null && cameraPosition != null){
|
||||
GeoPoint cameraGeoPoint = new GeoPoint(cameraPosition.getLatitude(),
|
||||
cameraPosition.getLongitude());
|
||||
|
||||
mapView.getController().setCenter(cameraGeoPoint);
|
||||
mapView.getController().animateTo(cameraGeoPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue