Nearby map does not show new pins when moving map a little, especially noticeable when zoomed in
nicolas-raoul opened this issue · 11 comments
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).
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.
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! 🙂
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.
Indeed!
@tristan81 Fantastic, thanks a lot! I assign to you for now, if that's OK with you. :-)
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
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! :-)
what is the significance of the marker/pin colours? Starting off grey and then changing to either red or green
@tristan81 That's good feedback that the meaning is not obvious, I just created #5841 :-)
@nicolas-raoul what do you think about the change?