aboutsummaryrefslogtreecommitdiff
path: root/mobile
diff options
context:
space:
mode:
Diffstat (limited to 'mobile')
-rw-r--r--mobile/App.js3
-rw-r--r--mobile/screens/MapPage.js47
2 files changed, 49 insertions, 1 deletions
diff --git a/mobile/App.js b/mobile/App.js
index f36b696..703c6eb 100644
--- a/mobile/App.js
+++ b/mobile/App.js
@@ -5,9 +5,10 @@ import { createStackNavigator, createAppContainer } from 'react-navigation';
import GreetingPage from './components/GreetingPage';
import FormPage from './screens/Form1';
+import MapPage from './screens/MapPage';
-const RootStack = createStackNavigator( {GreetingPage: GreetingPage, FormPage: FormPage,},
+const RootStack = createStackNavigator( {GreetingPage: GreetingPage, FormPage: FormPage, MapPage: MapPage},
{headerMode: 'none'})
const App = createAppContainer(RootStack)
diff --git a/mobile/screens/MapPage.js b/mobile/screens/MapPage.js
new file mode 100644
index 0000000..813432d
--- /dev/null
+++ b/mobile/screens/MapPage.js
@@ -0,0 +1,47 @@
+import React, { Component } from 'react';
+import { Text, View, Alert, StyleSheet, Button, AppRegistry, Navigator, TouchableHighlight, Platform} from 'react-native';
+import { Ionicons } from '@expo/vector-icons';
+import { createStackNavigator, createAppContainer } from 'react-navigation';
+import { Location, Permissions, Constants } from 'expo';
+import {MapView} from 'expo';
+
+// press location on map
+// on press, drop pin at location, ask user to confirm the location
+// redirect to the formpage
+
+
+// default initial map region is Toronto
+//var Initial_region_coordinates = [-79.3832, 43.6532];
+
+export default class Form1 extends Component {
+
+ constructor(props) {
+ super(props);
+ // const { navigation } = this.props;
+ // const coordinates = navigation.getParam('coordinates');
+ this.state = {
+ initial_region_coordinates: [-79.3832, 43.6532],
+ }
+ }
+
+ /*get_region_coordinates() {
+ const { navigation } = this.props;
+ const coordinates = navigation.getParam('coordinates');
+ return coordinates;
+ }*/
+
+ render() {
+ return (
+ <MapView
+ style={{ flex: 1 }}
+ initialRegion={{
+ latitude: this.state.initial_region_coordinates[1],
+ longitude: this.state.initial_region_coordinates[0],
+ latitudeDelta: 0.0922,
+ longitudeDelta: 0.0421,
+ }}
+ />
+ );
+ }
+
+} \ No newline at end of file