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

ALS-1969 Location disable search fix #106

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wadhawh
Copy link
Contributor

@wadhawh wadhawh commented Feb 3, 2025

Issue #, if available:

Description of changes:
fix: when the location is disabled, take the location from the centre of the map to calculate the search distance.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
location_disable_search

Comment on lines +1079 to 1081
if (!isDefaultLocationNeeded) return mLatLng

return if (mLatLng == null) {

Choose a reason for hiding this comment

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

My understanding of the prior code is

  1. It checks if isLocationComponentActivated = null, which I'm guessing is the check to understand if the live location is enabled
  2. If null, returns the default location.

i'm not sure I follow why we need an additional flag - Doesn't the current code also do the same?

Choose a reason for hiding this comment

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

On the flip side if we know that a default location is needed from the caller, we should instead have a different method getDefaultLocation that returns mLatLng and update occurrences of getLiveLocation(true)/getLiveLocation() to getDefaultLocation instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants