-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (40 loc) · 1.1 KB
/
App.js
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
/* eslint-disable react/no-unused-state */
import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';
import { Provider as PaperProvider } from 'react-native-paper';
import '@mapbox/polyline';
import BottomBar from './components/layout/BottomBar';
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
justifyContent: 'flex-end',
},
map: {
flex: 38,
zIndex: 1,
},
});
function App() {
const [coords, setCoords] = useState([]);
return (
<PaperProvider>
<View style={styles.container}>
<MapView
provider={PROVIDER_GOOGLE}
style={styles.map}
region={{
latitude: 51.0447,
longitude: -114.0719,
latitudeDelta: 0.03,
longitudeDelta: 0.05,
}}
>
<MapView.Polyline coordinates={coords} strokeWidth={2} strokeColor="red" />
</MapView>
<BottomBar bottomBarClick={c => setCoords(c)} />
</View>
</PaperProvider>
);
}
export default App;