Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issue #5704: Upload Wizard: "Edit location" shows my location instead of picture's location #5716

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jason-Whitmore
Copy link

Description (required)

Fixes #5704. When editing a location on the upload wizard, the map will now center on the picture's location which is retrieved from the picture's metadata. If this location metadata does not exist, the map will center on the device's GPS location.

What changes did you make and why?:
I added a simple check which primarily sees if the cameraPosition object (which contains image location metadata) is not null. If it is not null, the map is centered at the cameraPosition's coordinates.

Prior to this change, code called within setupMapView() (LocationPickerActivity.java:239, right above the new code) would center the map on the image location (if available), then center the map on the device's current or last known GPS location. This change simply attempts centering the map to the image location again.

This change is a simple solution. Code within LocationPickerActivity.java could be refactored to have a more elegant solution, but I don't know if that should be done for this issue or as a new issue.

Tests performed (required)

Tested betaDebug on the Android Studio emulator with API level 34.

Screenshots (for UI changes only)
In the following demonstration, I have set the emulator device location to NYC. I have two pictures on the device to upload. Both pictures are taken in Seattle, WA. The first picture has location metadata, the second does not.

When editing the location on the first picture, the map is correctly centered on the picture's location. When adding the location on the second picture, the map is centered on the device's current location in NYC.

location_bugfix_compressed.webm

…ap centering

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload Wizard: "Edit location" shows my location instead of picture's location
1 participant