Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Nightyyyyyy opened this issue Nov 19, 2024 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@Nightyyyyyy
Copy link

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

@Nightyyyyyy Nightyyyyyy added the bug 🪲 Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant