-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
40 lines (37 loc) · 921 Bytes
/
Copy pathApp.js
File metadata and controls
40 lines (37 loc) · 921 Bytes
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
import React, { useState, useEffect } from "react";
import { StyleSheet } from "react-native";
import Mapview, { Marker } from "react-native-maps";
function App() {
const [latitude, setLatitude] = useState(23.82235);
const [longitude, setLongitude] = useState(90.365417);
const [latitudeDelta, setLatitudeDelta] = useState(0.0922);
const [longitudeDelta, setLongitudeDelta] = useState(0.0421);
return (
<Mapview
style={styles.map}
initialRegion={{
latitude: latitude,
longitude: longitude,
latitudeDelta: latitudeDelta,
longitudeDelta: longitudeDelta,
}}
>
<Marker
coordinate={{
latitude: 23.82235,
longitude: 90.365417,
}}
/>
</Mapview>
);
}
const styles = StyleSheet.create({
map: {
position: "absolute",
top: 0,
bottom: 0,
left: 0,
right: 0,
},
});
export default App;