-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathMap.js
67 lines (59 loc) · 1.71 KB
/
Map.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
59
60
61
62
63
64
65
66
67
/**
* This is the Store finder page
**/
// React native and others libraries imports
import React, { Component } from 'react';
import { Container, Content, View, Icon, Left, Button, Item, Input } from 'native-base';
import { Actions } from 'react-native-router-flux';
import MapView from 'react-native-maps';
// Our custom files and classes import
import Text from '../component/Text';
import Navbar from '../component/Navbar';
import Colors from '../Colors';
export default class Map extends Component {
map = null;
constructor(props) {
super(props);
this.state = {
region: {
latitude: 48.85837009999999,
longitude: 2.2944813000000295,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421
},
marker: {
title: 'STORE PARIS',
address: '21 bis rue de la trippe, paris',
coord: {
latitude: 48.85837009999999,
longitude: 2.2944813000000295
}
}
};
}
render() {
var left = (
<Left style={{flex:1}}>
<Button transparent onPress={() => Actions.pop()}>
<Icon name="ios-close" size={38} style={{fontSize: 38}} />
</Button>
</Left>
);
return(
<Container style={{backgroundColor: '#fdfdfd'}}>
<MapView
ref={map => { this.map = map }}
region={this.state.region}
style={{position: 'absolute', top: 0, left: 0, right: 0, bottom: 0}}
>
<MapView.Marker
title={this.state.marker.title}
description={this.state.marker.address}
coordinate={this.state.marker.coord}
/>
</MapView>
<Navbar left={left} title="FIND US" />
</Container>
);
}
}