I am using react-native-maps library to show google maps in react-native application. I am tracking user movement and want to rotate the map when location will be changed. For map rotation I am calculating rotation angle and using animateCamera trying to rotate the map like the following:
this.map.animateCamera({
heading: rotation,
center: {latitude: currentLocation.latitude, longitude: currentLocation.longitude},
pitch: this.state.currentAngle
}, {duration: 1000});
I've checked and rotation, latitude, longitude, currentAngle
are not null or empty objects
But this method throws an error like this:
After this, I tried to use animateToBearing method, which is deprecated, as documentation says, but works nicely and rotates the map but shows the deperecation warning.
Versions:
expo: 32.0.0,
expo-cli: 2.2.0,
react-native-maps: 0.23.0
Any solutions?
P.S. I've searched similar questions on github.com and stackoverflow.com and this question is not duplicated
ndk { abiFilters 'armeabi-v7a' }
toapp/build.gradle
underdefaultConfig
properties. Try it. EDIT: I don't use Expo and I don't know how android code is executed with Expo. – Sweet