I'm on version 0.22.1 on react-native-maps, when i try to use the new animateCamera method from the MapView component, it complains that it is undefined and not a function, but the deprecated animateToRegion method still works.
I'm on version 0.22.1 on react-native-maps, when i try to use the new animateCamera method from the MapView component, it complains that it is undefined and not a function, but the deprecated animateToRegion method still works.
animateCamera is working. I already used in my project and there's no problem.
code example:
const mapRef = useRef(null);
useEffect(() => {
if (mapRef.current) {
mapRef.current.animateCamera({
center: {latitude, longitude},
});
}
},[currentPosition]);
<MapView
ref={mapRef}
style={styles.mapContainer}
initialRegion={{
...currentPosition,
latitudeDelta: 0.001,
longitudeDelta: 0.001,
}}
>
<Marker coordinate={currentPosition} />
</MapView