From 11fb7daf4518c6605bf8f6a9034b644e968e594c Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Sat, 17 Oct 2020 14:12:09 -0400 Subject: [PATCH] feat: initial create of mapview --- components/MapView/index.js | 37 +++++++++++++++++++++++++++++++++ domains/DataCollection/index.js | 3 +++ package-lock.json | 5 +++++ package.json | 3 ++- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 components/MapView/index.js diff --git a/components/MapView/index.js b/components/MapView/index.js new file mode 100644 index 000000000..4ccc2a235 --- /dev/null +++ b/components/MapView/index.js @@ -0,0 +1,37 @@ +import React from 'react'; +import MapView from 'react-native-maps'; +import { StyleSheet, Text, View, Dimensions } from 'react-native'; + +const Maps = () => { + const [region, setRegion] = React.useState({ + latitude: 37.78825, + longitude: -122.4324, + latitudeDelta: 0.0922, + longitudeDelta: 0.0421, + }) + return ( + + + + ) +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, + mapStyle: { + width: Dimensions.get('window').width * .95, + height: Dimensions.get('window').height / 2, + marginTop: 10, + borderRadius: 10 + }, +}); + +export default Maps \ No newline at end of file diff --git a/domains/DataCollection/index.js b/domains/DataCollection/index.js index b8c46cb75..1606df6ed 100644 --- a/domains/DataCollection/index.js +++ b/domains/DataCollection/index.js @@ -11,6 +11,7 @@ import { import { layout, theme } from '../../modules/theme'; import Header from '../../components/Header'; +import MapView from '../../components/MapView' import Forms from './Forms'; import FormGallery from './FormGallery'; @@ -143,6 +144,8 @@ const DataCollection = ({ navigation }) => { */} + + navigateToNewRecord()}> diff --git a/package-lock.json b/package-lock.json index 1b4d1523d..e5664b3d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16089,6 +16089,11 @@ "resolved": "https://registry.npmjs.org/react-native-localize/-/react-native-localize-1.3.3.tgz", "integrity": "sha512-lpKx/iqDKQ7dC58fb/vGGERLT4ZYfk+H2AXMg6aaVkgv8eEIgApQAzB2Oaotx7FIM/RopJponUFyJ4PMIHi4Rw==" }, + "react-native-maps": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-0.27.1.tgz", + "integrity": "sha512-HygBkZBecTnIVRYrSiLRAvu4OmXOYso/A7c6Cy73HkOh9CgGV8Ap5eBea24tvmFGptjj5Hg8AJ94/YbmWK1Okw==" + }, "react-native-paper": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/react-native-paper/-/react-native-paper-3.11.0.tgz", diff --git a/package.json b/package.json index a54d16f08..cebb08a88 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,8 @@ "react-redux": "7.2.0", "redux": "4.0.5", "redux-actions": "2.6.5", - "yup": "0.29.3" + "yup": "0.29.3", + "react-native-maps": "0.27.1" }, "devDependencies": { "@babel/core": "7.10.2",