Skip to content

Fixes Issue 6308: Explore map shows image at my location rather than at shown location #6315

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

Merged
merged 3 commits into from
May 21, 2025

Conversation

Jason-Whitmore
Copy link
Contributor

Description (required)

Fixes #6308

What changes did you make and why?

The primary change I made was to ExploreMapPresenter.updateMap(). In this method, a check was added to see if the user had selected "See in Explore" from Nearby recently. If so, the stored coordinates from Nearby is used to search for markers. If not, the user's GPS coordinates are used instead.

A boolean flag recentlyCameFromNearbyMap is used to prevent the Nearby map coordinates from being used again if the user presses the GPS button to focus on their current GPS location.

Methods to simplify access and modification of data were also added.

Tests performed (required)

Tested ProdDebug on Android Studio Emulator with API level 36.

Screenshots (for UI changes only)
issue_6308_compress.webm

Jason-Whitmore and others added 3 commits May 19, 2025 15:50
…er Explore map behavior

Before this commit, there was no way to tell if the user had arrived from the Nearby and
before the Nearby map center location had been searched for markers.

This commit adds a boolean flag to indicate this situation. Access, modification, and
initialization methods were added for this boolean value. Additionally, a helper
method to retrieve the Nearby map center LatLng was added as a convienience.
…tLng when appropriate

Before this commit, when the user selected "Show in explore" in Nearby when no pins were
on the map, Explore would only search for markers at the user's current GPS location,
rather than those at the Nearby map center.

After this commit, code was added to check if the user recently came from the Nearby map.
If so, the stored coordinates of the Nearby map is searched rather than the user's current
GPS coordinates. Additionally, the boolean that indicates that the user recently came
from the Nearby map is set to false. This ensures that the stored Nearby map center
coordinates are not used when the user taps the icon to focus the map on their
current location.
Copy link

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed solves the issue.
Thanks! 🙂
And sorry for the delay, I was on another trip.

@nicolas-raoul nicolas-raoul merged commit eb617ae into commons-app:main May 21, 2025
1 check passed
sonalyadav1 pushed a commit to sonalyadav1/apps-android-commons that referenced this pull request May 22, 2025
…at shown location (commons-app#6315)

* ExploreMapFragment.java: add helper methods and fields to enable proper Explore map behavior

Before this commit, there was no way to tell if the user had arrived from the Nearby and
before the Nearby map center location had been searched for markers.

This commit adds a boolean flag to indicate this situation. Access, modification, and
initialization methods were added for this boolean value. Additionally, a helper
method to retrieve the Nearby map center LatLng was added as a convienience.

* ExploreMapPresenter.java: fix map update code to search for Nearby LatLng when appropriate

Before this commit, when the user selected "Show in explore" in Nearby when no pins were
on the map, Explore would only search for markers at the user's current GPS location,
rather than those at the Nearby map center.

After this commit, code was added to check if the user recently came from the Nearby map.
If so, the stored coordinates of the Nearby map is searched rather than the user's current
GPS coordinates. Additionally, the boolean that indicates that the user recently came
from the Nearby map is set to false. This ensures that the stored Nearby map center
coordinates are not used when the user taps the icon to focus the map on their
current location.

---------

Co-authored-by: Nicolas Raoul <[email protected]>
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.

When coming from "Show in Explore", Explore map shows image at my location rather than at shown location
2 participants