You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Follow user location is lost when zooming the map in/out #3115
// 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.
@jaltin pls try current main, you can add a <Viewport transitionsToIdleUponUserInteraction={false} /> to the MapView and then it should alter the behaviour
@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.
How we can capture the swipe user interaction to exist follow user mode?
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.
@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.
How we can capture the swipe user interaction to exist follow user mode?
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.
Activity
mfazekas commentedon Nov 3, 2023
I guess we want to expose https://docs.mapbox.com/android/maps/api/10.6.1/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-viewport-options/transitions-to-idle-upon-user-interaction.html
https://docs.mapbox.com/ios/maps/api/10.6.1/Structs/ViewportOptions.html#/s:10MapboxMaps15ViewportOptionsV36transitionsToIdleUponUserInteractionSbvp
jaltin commentedon Nov 6, 2023
@mfazekas yes that seems like it should fix the issue.
Is that a hard thing for you to implement?
jaltin commentedon 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 commentedon Nov 13, 2023
@jaltin pls try current main, you can add a
<Viewport transitionsToIdleUponUserInteraction={false} />to the MapView and then it should alter the behaviourandrei-tofan commentedon Nov 16, 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.gesturesSettingswork withtransitionsToIdleUponUserInteraction={false}? Asking because noticed that when is set tofalsesometimes 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 commentedon Nov 27, 2023
@mfazekas do you have any ideas on how to address the scenario above?
jaltin commentedon Dec 4, 2023
Hi @mfazekas,
Do you have any idea of how we can achieve what @andrei-tofan asked 3 weeks ago?
Thx!
mfazekas commentedon Dec 4, 2023
@mfazekas sorry didn't have time to look into this.
andrei-tofan commentedon Jan 17, 2024
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 commentedon Jan 24, 2024
based on the mapbox documentation it looks like need to listen for gestures and update the camera accordingly to address this, right?
lgspacil commentedon 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?feat(Viewport): per-gesture transitionsToIdleUponUserInteraction
feat(Viewport): per-gesture transitionsToIdleUponUserInteraction (rnm…