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

Nearby map does not show new pins when moving map a little, especially noticeable when zoomed in #5835

Open
nicolas-raoul opened this issue Sep 19, 2024 · 9 comments
Assignees

Comments

@nicolas-raoul
Copy link
Member

There are many nearby items in the forest shown bv this screencast, but Nearby shown none until I move the map far enough.

Similarly, the railroad followed in the screencast has nearby items everywhere all along the way, but Nearby only shows pins in a few areas along the railroad.

screen-20240919-140209.mp4

Maybe the algorithm only checks distance from current "center" when moving. It should load misping pins even when moving just a little (ideally without reloading the pins that were already visible).

@tristan81
Copy link
Contributor

@nicolas-raoul

2000 metres from current location has been hardcoded, it is hardcoded in the explore screen as well but in that case it displays the 'search this area' button instead of automatically initiating a search. It's interesting that the Nearby and Explore screens don't share a codebase. I'm not an Android dev so I don't know if that is common, seems like it would be better if it was just the same codebase running in two different modes.

Nearby
image

Explore
image

@nicolas-raoul
Copy link
Member Author

Thanks for checking!
We would need to:

  • Reduce the 2km to something like 100 meters or even remove it if that makes sense.
  • Verify that panning the map is rdasonably smooth and loads the missing pins.

Thanks for noticing the duplication! Would you mind filing a new issue about it?

Thanks a lot! 🙂

@tristan81
Copy link
Contributor

potentially it would need to be proportional to the zoom level rather than a fixed number, reducing the threshold number too low will have the inverse effect of making small movements trigger too many refreshes/searches at zoomed out levels.

@nicolas-raoul
Copy link
Member Author

Indeed!

@tristan81
Copy link
Contributor

I could have time to look at this over the course of this week, including #5836

@nicolas-raoul
Copy link
Member Author

@tristan81 Fantastic, thanks a lot! I assign to you for now, if that's OK with you. :-)

@tristan81
Copy link
Contributor

My initial testing is that there are deeper changes required here, potentially introducing on device caching of data points or other changes like managing the successive firing of onscroll events that meet the distance threshold. Decreasing the distance threshold or introducing a ratio using zoom level both result in HTTP 500 errors when scrolling more than once within a few seconds. It seems like the server API either can't handle successive search requests within a short time span or there is some kind of throttling where it is refusing successive get requests. This is probably why the distance has been set to 2000m

A user can cause multiple onscroll events to fire faster than the API can return search results

@nicolas-raoul
Copy link
Member Author

I think we already cache data points.

For the error 500, how about introducing a wait time if the previous request was less than N seconds ago, so that we do not perform more than 1 query per N seconds? We can experiment with various values of N to see what the server supports and what the UX feels like.

Thanks! :-)

@tristan81
Copy link
Contributor

what is the significance of the marker/pin colours? Starting off grey and then changing to either red or green

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

No branches or pull requests

2 participants