-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmap.js
160 lines (144 loc) · 3.12 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import {
ListView,
Platform,
StyleSheet,
View,
Alert,
AppRegistry,
Image,
TouchableHighlight,
ScrollView,
AsyncStorage,
TextInput,
DatePickerIOS,
TouchableOpacity
} from "react-native";
import MapView from "react-native-maps";
import style from "./style";
import { StackNavigator, NavigationActions } from "react-navigation";
import {
Container,
Body,
Header,
Item,
Input,
Icon,
Content,
Footer,
FooterTab,
Button,
Badge,
StyleProvider,
Text,
Card,
CardItem,
Separator,
Left,
Right,
Title,
ListItem
} from "native-base";
import getTheme from "./native-base-theme/components";
import platform from "./native-base-theme/variables/platform";
import firebase from "./firebaseConfig";
export default class Map extends Component {
static navigationOptions = {
title: "Map",
header: null
};
constructor(props) {
super(props);
this.state = {
region: {
latitude: -34.92866,
longitude: 138.600993,
latitudeDelta: 0.01,
longitudeDelta: 0.01
// latitudeDelta: 0.0922,
// longitudeDelta: 0.0421
},
coordinate: {
latitude: -34.92866,
longitude: 138.600993
}
};
}
onRegionChange(region) {
this.setState({ region });
}
render() {
return (
<View style={style.pageContainer}>
<View style={style.contentContainer}>
<StyleProvider style={getTheme(platform)}>
<Header>
<Button
transparent
onPress={() => this.props.navigation.goBack()}
>
<Icon
style={{ color: "#808080" }}
name="arrow-back"
onPress={() => this.props.navigation.goBack()}
/>
</Button>
<Body>
<Title>Location</Title>
</Body>
</Header>
</StyleProvider>
<MapView style={styles.map} region={this.state.region}>
<MapView.Marker
coordinate={this.state.coordinate}
title="Carnegie Mellon University Australia Library"
description="Torrens Building, 220 Victoria Square, Adelaide, SA"
/>
</MapView>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
input_Instruction: {
fontSize: 20,
textAlign: "left",
//color: '#FDFEFE',
// fontWeight: "bold",
fontFamily: "Apple SD Gothic Neo",
marginBottom: 4
},
input_Instruction2: {
fontSize: 24,
textAlign: "left",
color: "#990000",
fontWeight: "bold",
fontFamily: "Apple SD Gothic Neo",
marginBottom: 4
},
input_Instruction3: {
fontSize: 24,
textAlign: "left",
fontWeight: "bold",
fontFamily: "Apple SD Gothic Neo",
marginBottom: 4
},
contactView: {
marginTop: 10,
marginLeft: 15,
marginBottom: 10
},
map: {
position: "absolute",
top: 65,
left: 0,
right: 0,
bottom: 0
}
});