Skip to content

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

Closed

Description

@jaltin

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

Activity

  1. jaltin commented on Nov 6, 2023

    @jaltin
    ContributorAuthor

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

    Is that a hard thing for you to implement?

  2. jaltin commented on Nov 13, 2023

    @jaltin
    ContributorAuthor

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

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

  3. mfazekas commented on Nov 13, 2023

    @mfazekas
    Contributor

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

  4. andrei-tofan commented on Nov 16, 2023

    @andrei-tofan
    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.
  5. andrei-tofan commented on Nov 27, 2023

    @andrei-tofan
    Contributor

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

  6. jaltin commented on Dec 4, 2023

    @jaltin
    ContributorAuthor

    @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!

  7. mfazekas commented on Dec 4, 2023

    @mfazekas
    Contributor

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

  8. andrei-tofan commented on Jan 17, 2024

    @andrei-tofan
    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?

  9. andrei-tofan commented on Jan 24, 2024

    @andrei-tofan
    Contributor

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

  10. lgspacil commented on Mar 29, 2024

    @lgspacil

    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?

  11. added a commit that references this issue on Oct 23, 2026
    9ed4eff
  12. added a commit that references this issue on Oct 25, 2026
    dc41695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions