-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapScreen.js
58 lines (52 loc) · 1.59 KB
/
MapScreen.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, { Component } from 'react';
import MapView, { PROVIDER_GOOGLE, Callout } from 'react-native-maps';
import { Text } from 'react-native';
export class MapScreen extends Component {
constructor(props){
super(props)
}
state={
// currentLocation : this.props.location
}
componentDidMount(){}
render() {
return (
<>
<MapView
provider={PROVIDER_GOOGLE}
style={{ minHeight: 300, minWidth: '90%', padding: 10 }}
initialRegion={{
latitude: 13.0827,
longitude: 80.2707,
latitudeDelta: 0.001,
longitudeDelta: 0.001
}}
showsUserLocation={true}
>
<MapView.Marker
coordinate={{
latitude: 13.0827,
longitude: 80.2707
}}
title={"Your Location"}
draggable>
<Callout>
<Text>
Chennai
</Text>
</Callout>
</MapView.Marker>
{/* <MapView.Marker
coordinate={{
latitude: 10.5,
longitude: 10.5
}}
title={"Your Location"}
draggable /> */}
</MapView>
<Text> {this.state.currentLocation ? this.state.currentLocation : "Hello"} </Text>
</>
)
}
}
export default MapScreen