Skip to content

Commit

Permalink
feat: initial create of mapview
Browse files Browse the repository at this point in the history
  • Loading branch information
hopetambala committed Oct 17, 2020
1 parent 6d86d2b commit 11fb7da
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
37 changes: 37 additions & 0 deletions components/MapView/index.js
Original file line number Diff line number Diff line change
@@ -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 (
<View style={styles.container}>
<MapView
style={styles.mapStyle}
region={region}
onRegionChange={setRegion}
/>
</View>
)
}

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
3 changes: 3 additions & 0 deletions domains/DataCollection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -143,6 +144,8 @@ const DataCollection = ({ navigation }) => {
</View>
</View>
<View style={styles.horizontalLine} /> */}
<MapView />

<View style={styles.screenFlexRowWrap}>
<View style={styles.cardContainer}>
<Card style={styles.cardSmallStyle} onPress={() => navigateToNewRecord()}>
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 11fb7da

Please sign in to comment.