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:
Jason-Whitmore 2024-06-09 12:24:40 -07:00 committed by GitHub
parent bb4cfe421a
commit 3dc7180784
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}
}
/**