LocationPickerActivity.java: fix "Show in Map App" bug

Once the "Show in Map App" button is pressed, the Map app will center on the current photo's EXIF location,
if that data is available. If not, the map app will center on where the location picker's map is centered.
Javadoc updated to reflect this small change.
This commit is contained in:
Jason Whitmore 2024-05-24 16:56:01 -07:00
parent 93f1e1ec29
commit c6a7a5ec48

View file

@ -364,12 +364,19 @@ public class LocationPickerActivity extends BaseActivity implements
}
/**
* Show the location in map app
* Show the location in map app. Map will center on EXIF location, if available.
*/
public void showInMap() {
Utils.handleGeoCoordinates(this,
new fr.free.nrw.commons.location.LatLng(mapView.getMapCenter().getLatitude(),
mapView.getMapCenter().getLongitude(), 0.0f));
//Check to see if EXIF location data is available
if(cameraPosition != null){
Utils.handleGeoCoordinates(this,
new fr.free.nrw.commons.location.LatLng(cameraPosition.getLatitude(),
cameraPosition.getLongitude(), 0.0f));
} else {
Utils.handleGeoCoordinates(this,
new fr.free.nrw.commons.location.LatLng(mapView.getMapCenter().getLatitude(),
mapView.getMapCenter().getLongitude(), 0.0f));
}
}
/**