rnmapbox / rnmapbox/maps

[Bug]: When I call flyTo first and then zoomTo, only zoomTo works, but when I comment out zomTo, flyTo works

Open
#3,697 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug 🪲
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.