Search code examples
reactjsreact-nativereact-native-maps

How to show direction on react Native Maps


I am trying to implement a moving car on react native maps but the polyline component doesn’t seems to work fine. Any ideas on how to implement this just like the way Uber does it.


Solution

  • you can use react native direction and react native maps libraries that take your origin location and coordinate of the another location to draw the direction line

        ` <MapView initialRegion={…}>
           <MapViewDirections
           origin={origin}
        destination={destination}
        apikey={GOOGLE_MAPS_APIKEY}
      />
    </MapView>`