mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

No effect if set the bearing of FollowPuckViewportStateOptions to null

Open ystsoi opened this issue 2 years ago • 2 comments

Environment

  • Maps SDK Version: 10.14.0

Observed behavior and steps to reproduce

The map does not follow the location, using the following code:

viewportPlugin.transitionTo(
    viewportPlugin.makeFollowPuckViewportState(
        FollowPuckViewportStateOptions.Builder()
            .bearing(null)
            .build()
    )
)

Expected behavior

The map should at least follow the location, similar to:

viewportPlugin.transitionTo(
    viewportPlugin.makeFollowPuckViewportState(
        FollowPuckViewportStateOptions.Builder()
            .build()
    )
)

or:

viewportPlugin.transitionTo(
    viewportPlugin.makeFollowPuckViewportState(
        FollowPuckViewportStateOptions.Builder()
            .bearing(FollowPuckViewportStateBearing.Constant(0.0))
            .build()
    )
)

ystsoi avatar Jun 21 '23 11:06 ystsoi

Same here

SamYStudiO avatar Jun 29 '23 20:06 SamYStudiO

Hi thanks for reporting this issue. We'll look into it.

Meanwhile, you can workaround it by setting bearing to the default value FollowPuckViewportStateBearing.SyncWithLocationPuck instead of null:

viewportPlugin.transitionTo(
    viewportPlugin.makeFollowPuckViewportState(
        FollowPuckViewportStateOptions.Builder()
            .bearing(FollowPuckViewportStateBearing.SyncWithLocationPuck)
            .build()
    )
)

jush avatar Jun 30 '23 06:06 jush