Skip to content

[Bug]: MapView::onCameraChanged() does not trigger #3879

@sssilver

Description

@sssilver

Mapbox Implementation

Mapbox

Mapbox Version

11.8.0

React Native Version

19.1.0

Platform

iOS

@rnmapbox/maps version

10.1.39

Standalone component to reproduce

import React from "react";
import { StyleSheet, View } from "react-native";
import Mapbox, { MapState } from "@rnmapbox/maps";

Mapbox.setAccessToken(
  "<ACCESS_TOKEN>"
);

const Map: React.FC = () => {
  const handleCameraChanged = (state: MapState) => {
    console.log("Camera changed!");
  };

  return (
    <View style={styles.container}>
      <Mapbox.MapView
        style={styles.map}
        onCameraChanged={handleCameraChanged}
      >
      </Mapbox.MapView>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  map: {
    flex: 1,
  },
});

export default Map;

Observed behavior and steps to reproduce

handleCameraChanged() is not being called when the map view is being manipulated by either pinching or panning.

Expected behavior

handleCameraChanged() gets called

Notes / preliminary analysis

No response

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions