mapbox-maps-android
mapbox-maps-android copied to clipboard
No effect if set the bearing of FollowPuckViewportStateOptions to null
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()
)
)
Same here
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()
)
)