Reputation: 131
I am making an tracking app with RN 0.50.1, and using react-native-maps for showing user location on maps with custom image on MapView.Marker "image" props.
The location works fine, also the tracking works fine but the problem is the marker jumps from one co-ordinate to another on lat long change. Have tried setting the state with MapView.AnimatedRegion and update the coordinates using timing method, but no luck. Also have used https://github.com/airbnb/react-native-maps/blob/master/example/examples/AnimatedMarkers.js example but still no luck which explains to use Animated.Region, but it gives me error of Animated.Region is not a constructor.
I need a smooth movement of marker on lat long change.
My Package.JSON file -
{
"name": "XXXX",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"firebase": "^4.6.1",
"lottie-react-native": "^2.2.7",
"moment": "^2.19.1",
"react": "^16.0.0",
"react-native": "0.50.1",
"react-native-android-permissions": "^1.0.0",
"react-native-code-push": "^5.1.3-beta",
"react-native-maps": "^0.17.1",
"react-native-responsive-dimensions": "^1.0.1",
"react-native-router-flux": "^4.0.0-beta.22",
"react-native-simple-toast": "0.0.7",
"react-native-vector-icons": "^4.4.2"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-preset-react-native": "4.0.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
}
Any help appreciated. Please.
Upvotes: 1
Views: 2546
Reputation:
I think you want to take a look at MapView
methods (e.g. animateToCoordinates
).
Upvotes: 1