[Bug]: When I call flyTo first and then zoomTo, only zoomTo works, but when I comment out zomTo, flyTo works
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 2.9k
- Forks
- 947
- Avg merge
- 6d 37m
- Merged PRs (30d)
- 1
Description
Mapbox Implementation
Mapbox GL
Mapbox Version
default
React Native Version
0.74.3
Platform
Android
@rnmapbox/maps version
10.1.28
Standalone component to reproduce
import React from 'react';
import {
MapView,
ShapeSource,
LineLayer,
Camera,
} from '@rnmapbox/maps';
const aLine = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};
class BugReportExample extends React.Component {
render() {
return (
<MapView style={{flex: 1}}>
<Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" />
</ShapeSource>
</MapView>
);
}
}
Observed behavior and steps to reproduce
await mapCameraRef?.current.flyTo(lonlatArr)
await mapCameraRef?.current.zoomTo(16)
https://github.com/user-attachments/assets/a403a350-d821-4633-a8d1-f7173bf358fd
Expected behavior
The flyTo function takes effect first to move the viewing position, and then the zoomTo function takes effect to zoom in on the zoom level
Notes / preliminary analysis
No response
Additional links and references
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the standalone React Native example and the Camera ref calls shown in the report, reproducing the Android behavior with @rnmapbox/maps 10.1.28. Trace the flyTo and zoomTo camera operations from their public React Native entry points into the Android implementation. Done means flyTo moves the viewing position before zoomTo applies the requested zoom level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100