Description:
This is a directions component for react-native-maps that allows to draw a route between two coordinates, powered by the Google Maps Directions API.
Installation:
# Yarn $ yarn add react-native-maps-directions # NPM $ npm install react-native-maps-directions --save
Basic usage:
import MapViewDirections from 'react-native-maps-directions';
const origin = {latitude: 37.3318456, longitude: -122.0296002};
const destination = {latitude: 37.771707, longitude: -122.4053769};
const GOOGLE_MAPS_APIKEY = 'YOUR GOOGLE API';
<MapView initialRegion={…}>
<MapViewDirections
origin={origin}
destination={destination}
apikey={GOOGLE_MAPS_APIKEY}
/>
</MapView>





