mapbox-maps-android
mapbox-maps-android copied to clipboard
Camera easeTo issues when using a custom style
Environment
Doesn't seem like a device issue. Tested on:
- Android OS version: 10, 12
- Devices affected: One Plus Nord (12) and Moto G8 (10)
- Maps SDK Version: 10.14.0
Observed behavior and steps to reproduce
I added a long click listener to the map, which calls easeTo
with the same coordinates each time.
When using a custom style, and calling easeTo
with the same coordinate bounds, the map continues to zoom in/out repeatedly.
Video demonstrating the bug.
See sample project based off mapbox sdk example apps.
Expected behavior
The map doesn't change when easeTo
is called with the same bounds multiple times.
Notes / preliminary analysis
When using a default mapbox style everything works as expected. Issue only presents when using our custom style.
loadStyle(styleExtension = style("mapbox://styles/mapbox/dark-v11") {}) // Works
loadStyle(styleExtension = style("mapbox://styles/pruthvikar/clj32gbff00qh01qy5eet238b") {}) // Bug
In the example project, there are 3 examples of coordinates which behave differently:
val worksFine = CoordinateBounds(
Point.fromLngLat(0.0, 51.0),
Point.fromLngLat(1.0, 52.0)
)
val zoomsInABit = CoordinateBounds(
Point.fromLngLat(11.12, 46.98),
Point.fromLngLat(11.14, 46.99)
)
val zoomsOutABit = CoordinateBounds(
Point.fromLngLat(11.12, 46.98),
Point.fromLngLat(12.14, 47.99)
)
Our ios app works fine using the same custom style, so i've ruled out it being an issue with the custom style.
Additional links and references
Quick note, while investigating a similar issue, we noticed that disabling 3d terrain on our custom style fixes both issues.