showing results for - "npm react native turn by turn navigation"
Amberly
21 Jan 2018
1import { OpenMapDirections } from 'react-native-navigation-directions';
2
3export default class App extends React.Component {
4 _callShowDirections = () => {
5    const startPoint = {
6      longitude: -8.945406,
7      latitude: 38.575078
8    } 
9
10    const endPoint = {
11      longitude: -8.9454275,
12      latitude: 38.5722429
13    }
14
15		const transportPlan = 'w';
16
17    OpenMapDirections(startPoint, endPoint, transportPlan).then(res => {
18      console.log(res)
19    });
20  }
21  
22  render() {
23    return (
24      <View style={styles.container}>
25        <Text>Show direction between two random points!</Text>
26        <Button
27        onPress={() => { this._callShowDirections() }}
28        title="Open map"
29        color="#841584"
30      />
31      </View>
32    );
33  }
34}
35