mapbox / mapbox/mapbox-maps-android

MapViewportState transitionToOverviewState AnimationDuration has no influence on the animation duration

Open
#2,683 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: 16
- Devices affected: Pixel 6a
- Maps SDK Version: 11.15.2

## Observed behavior and steps to reproduce

Using `MapViewportState.transitionToOverviewState`,
When setting a `OverviewViewportStateOptions`
Parameter animationDurationMs has no influence on the animation duration

## Expected behavior

The animation should follow the parameter animationDurationMs

## Notes / preliminary analysis

The animation duration seems to depend on the distance from the geometry that we want to go on.
It happens when we are to close to the geometry. However, we should still have a smooth animation and not a sort of "jump"

The code :

```kotlin
private fun MapViewportState.toOverview(
cameraModeOverview: CameraMode.Overview
) {
val geometry = MultiPoint
.fromLngLats(Polyline6.decodeToPoints(cameraModeOverview.geometryPolyline6))

transitionToOverviewState(
overviewViewportStateOptions = OverviewViewportStateOptions.Builder()
.geometry(geometry)
.padding(cameraModeOverview.paddingPx?.toEdgeInsets())
.animationDurationMs(DEFAULT_ANIMATION_DURATION) // 600L
.build()
}.build()
)
}
```

## Additional links and references

https://github.com/user-attachments/assets/0cc3bef6-d03a-4370-8006-e823ec2d2e98

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at MapViewportState.transitionToOverviewState and OverviewViewportStateOptions, then reproduce the behavior with animationDurationMs set while the target geometry is nearby. Trace how the requested duration is handled during the overview transition; done means the configured duration influences the animation and avoids a jump near the geometry.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.