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

[Bug]: Follow user location is lost when zooming the map in/out #3115

Open
jaltin opened this issue Oct 17, 2023 · 11 comments
Open

[Bug]: Follow user location is lost when zooming the map in/out #3115

jaltin opened this issue Oct 17, 2023 · 11 comments
Labels

Comments

@jaltin
Copy link
Contributor

jaltin commented Oct 17, 2023

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

iOS, Android

@rnmapbox/maps version

10.0.0-beta.11

Standalone component to reproduce

// This example shows the bug
// https://github.com/rnmapbox/maps/blob/main/example/src/examples/UserLocation/UserLocationRenderMode.tsx

Observed behavior and steps to reproduce

When in follow user location and I zoom in/out, the follow user location mode is lost and the user needs to reactivate the follow user location.

This applies in the following zoom scenarios:

  • Double tap to zoom in
  • 2-finger double tap to zoom out
  • Pinch in to zoom in
  • Pinch out to zoom out

See this example video of the issue (play it with sound):

v.10.bug.mov

Expected behavior

In the pre-v10 RN mapbox library this was not happening, as the follow user location was kept when zooming.

This is also how both apple and google maps works, and I think this is how RN mapbox should also work. I also tested the Mapbox sample app available in the Android app store, and there it works like Apple and Google maps apps.

I have attached a video of our app that shows how it worked before the v10 update. Turn on sound as I explain the issue in the video too.

sample.zoom.issue.mov

Notes / preliminary analysis

No response

Additional links and references

No response

@jaltin
Copy link
Contributor Author

jaltin commented Nov 6, 2023

@mfazekas yes that seems like it should fix the issue.

Is that a hard thing for you to implement?

@jaltin
Copy link
Contributor Author

jaltin commented Nov 13, 2023

Hi @mfazekas, I see that you are working on viewport (#3155 (comment)).

Am I correct in thinking that it will also solve this issue?

@mfazekas
Copy link
Contributor

@jaltin pls try current main, you can add a <Viewport transitionsToIdleUponUserInteraction={false} /> to the MapView and then it should alter the behaviour

@andrei-tofan
Copy link
Contributor

@mfazekas thanks for the fix! Setting <Viewport transitionsToIdleUponUserInteraction={false} /> addresses the problem with the follow user location being lost on zoom, the problem is we want to exit from follow user mode on swipe as described in the video from 'Expected behavior' and with only using this setting this is not possible.

  1. How we can capture the swipe user interaction to exist follow user mode?
  2. How does gesturesSettings work with transitionsToIdleUponUserInteraction={false}? Asking because noticed that when is set to false sometimes the screen feels like is frozen when you try to zoom in. In the older version if you zoom while in follow user mode there is a delay of a few seconds and then the camera points back to the user's location.

@andrei-tofan
Copy link
Contributor

@mfazekas do you have any ideas on how to address the scenario above?

@jaltin
Copy link
Contributor Author

jaltin commented Dec 4, 2023

@mfazekas thanks for the fix! Setting <Viewport transitionsToIdleUponUserInteraction={false} /> addresses the problem with the follow user location being lost on zoom, the problem is we want to exit from follow user mode on swipe as described in the video from 'Expected behavior' and with only using this setting this is not possible.

  1. How we can capture the swipe user interaction to exist follow user mode?
  2. How does gesturesSettings work with transitionsToIdleUponUserInteraction={false}? Asking because noticed that when is set to false sometimes the screen feels like is frozen when you try to zoom in. In the older version if you zoom while in follow user mode there is a delay of a few seconds and then the camera points back to the user's location.

Hi @mfazekas,

Do you have any idea of how we can achieve what @andrei-tofan asked 3 weeks ago?

Thx!

@mfazekas
Copy link
Contributor

mfazekas commented Dec 4, 2023

@mfazekas sorry didn't have time to look into this.

@andrei-tofan
Copy link
Contributor

Hi @mfazekas, do you think will have the time to look into this or at least give me some guidance on how to add support to this?

@andrei-tofan
Copy link
Contributor

based on the mapbox documentation it looks like need to listen for gestures and update the camera accordingly to address this, right?

@lgspacil
Copy link

lgspacil commented Mar 29, 2024

Any updates on this? I am running into a similar issue.
transitionsToIdleUponUserInteraction={false} prevents all interaction with the map.

@andrei-tofan when you set transitionsToIdleUponUserInteraction={false} were you able to interact with the map?

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

No branches or pull requests

4 participants