nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

How to add car animation to marker like uber with react native mapbox #1584

Closed nimeshbhalani7 closed 5 years ago

EugenePisotsky commented 5 years ago

it's a pain currently :) check this example: https://github.com/nitaliano/react-native-mapbox-gl/blob/master/example/src/components/DriveTheLine.js

the main idea there is to create an animation and listener to refresh coordinates. hope in future there will be native methods to move markers.

kristfal commented 5 years ago

Uber's cars are actually animated as a separate GL context on top of google maps (at least on iOS). The closest thing we can get to this at the moment is the animated shapeSources and custom markers as DriveTheLine example shows. Thanks for the link @RevanScript.