-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
53 lines (49 loc) · 1.3 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import * as React from 'react';
import {StyleSheet, View, Text} from 'react-native';
import MapboxNavigation from '@homee/react-native-mapbox-navigation';
function App() {
return (
<View style={styles.container}>
<MapboxNavigation
origin={[-97.760288, 30.273566]}
destination={[-97.918842, 30.494466]}
shouldSimulateRoute
showsEndOfRouteFeedback
onLocationChange={event => {
const {latitude, longitude} = event.nativeEvent;
}}
onRouteProgressChange={event => {
const {
distanceTraveled,
durationRemaining,
fractionTraveled,
distanceRemaining,
} = event.nativeEvent;
}}
onError={event => {
const {message} = event.nativeEvent;
}}
onCancelNavigation={() => {
// User tapped the "X" cancel button in the nav UI
// or canceled via the OS system tray on android.
// Do whatever you need to here.
}}
onArrive={() => {
// Called when you arrive at the destination.
}}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default App;