move marker with autocomplete
This commit is contained in:
parent
0b75dde08a
commit
77e8473cbd
|
@ -16,7 +16,10 @@ export default function HouseLocation() {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{marginTop: 50, flex: 1}}>
|
<View style={styles.viewRoot}>
|
||||||
|
<View>
|
||||||
|
<Text style={styles.heading}>Locate your House</Text>
|
||||||
|
<View>
|
||||||
<GooglePlacesAutocomplete
|
<GooglePlacesAutocomplete
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
fetchDetails={true}
|
fetchDetails={true}
|
||||||
|
@ -44,20 +47,21 @@ export default function HouseLocation() {
|
||||||
placeholderTextColor={'#845783'}
|
placeholderTextColor={'#845783'}
|
||||||
styles={{
|
styles={{
|
||||||
container: {
|
container: {
|
||||||
flex: 0,
|
|
||||||
position: 'absolute',
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
position: 'absolute',
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
backgroundColor: '#000000',
|
|
||||||
},
|
},
|
||||||
listView: {backgroundColor: 'white', color: 'blue'},
|
listView: {backgroundColor: 'white', color: 'blue'},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
<MapView
|
<MapView
|
||||||
style={styles.map}
|
style={styles.map}
|
||||||
initialRegion={{
|
region={{
|
||||||
latitude: 37.78825,
|
latitude: region.latitude,
|
||||||
longitude: -122.4324,
|
longitude: region.longitude,
|
||||||
latitudeDelta: 0.0922,
|
latitudeDelta: 0.0922,
|
||||||
longitudeDelta: 0.0421,
|
longitudeDelta: 0.0421,
|
||||||
}}
|
}}
|
||||||
|
@ -68,32 +72,20 @@ export default function HouseLocation() {
|
||||||
longitude: region.longitude,
|
longitude: region.longitude,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Marker
|
|
||||||
coordinate={pin}
|
|
||||||
pinColor="black"
|
|
||||||
draggable={true}
|
|
||||||
onDragStart={e => {
|
|
||||||
console.log('Drag start', e.nativeEvent.coordinates);
|
|
||||||
}}
|
|
||||||
onDragEnd={e => {
|
|
||||||
setPin({
|
|
||||||
latitude: e.nativeEvent.coordinate.latitude,
|
|
||||||
longitude: e.nativeEvent.coordinate.longitude,
|
|
||||||
});
|
|
||||||
}}>
|
|
||||||
<Callout>
|
|
||||||
<Text>I'm here</Text>
|
|
||||||
</Callout>
|
|
||||||
</Marker>
|
|
||||||
</MapView>
|
</MapView>
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
viewRoot: {
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#ffffff',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
@ -101,4 +93,10 @@ const styles = StyleSheet.create({
|
||||||
width: Dimensions.get('window').width,
|
width: Dimensions.get('window').width,
|
||||||
height: Dimensions.get('window').height,
|
height: Dimensions.get('window').height,
|
||||||
},
|
},
|
||||||
|
heading: {
|
||||||
|
color: '#1C254E',
|
||||||
|
fontSize: 30,
|
||||||
|
textAlign: 'left',
|
||||||
|
fontFamily: 'Ubuntu-Bold',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -108,15 +108,6 @@ underlayColor="white"
|
||||||
</TouchableHighlight>
|
</TouchableHighlight>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.headingContainer}>
|
<View style={styles.headingContainer}>
|
||||||
<SearchBar
|
|
||||||
placeholder="Search Here..."
|
|
||||||
lightTheme
|
|
||||||
round
|
|
||||||
editable={true}
|
|
||||||
value={search}
|
|
||||||
onChangeText={setSearch}
|
|
||||||
platform="android"
|
|
||||||
/>
|
|
||||||
<Text style={styles.heading}>John Doe</Text>
|
<Text style={styles.heading}>John Doe</Text>
|
||||||
<Text style={styles.subHeading}>Tenant</Text>
|
<Text style={styles.subHeading}>Tenant</Text>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue