i managed to overlapped my searchbar over react native mapview, however with that i wont be able to pitch or zoom onto my map, are there any solution to this?
reason i wanted to add touchablewithoutfeedback over googleplacesautocomplete is due that googleplacesautocomplete will always prompt out virtual keyboard
return (
<Provider>
<MapView style={{
height: '100%',
width: '100%',
}}
ref={mapRef}
onMapReady={goToMyLocation}
initialRegion={location}
showsUserLocation={true}
showsMyLocationButton={true}
followsUserLocation={true}
scrollEnabled={true}
zoomEnabled={true}
pitchEnabled={true}
rotateEnabled={true}
showsTraffic={true}>
{location &&
<Marker
image={require ('../../assets/map_icon.png')}
title="You are here"
coordinate={location.coords} /> }
</MapView>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{position: 'absolute', top: '5%', width: '100%', height: '100%'}}>
<GooglePlacesAutocomplete
placeholder="Search"
query={{
key: GOOGLE_PLACES_API_KEY,
language: 'en',
components: 'country:my'
}}
GooglePlacesDetailsQuery={{fields: 'geometry'}}
fetchDetails={true}
listViewDisplayed='auto'
autoFocus={false}
enableHighAccuracyLocation={true}
enablePoweredByContainer={false}
onPress={(data, details = null) => {
console.log('data:', data)
console.log('details:', details)
console.log(JSON.stringify(details?.geometry?.location))
}}
onFail={error => console.log(error)}
onNotFound={() => console.log('no results')}
textInputProps={{
autoFocus: true,
blurOnSubmit: false,
}}
isRowScrollable={true}
styles={{
textInput: {
height: 35,
width: '80%',
fontSize: 16,
borderRadius: 12,
borderColor: '#5A5A5A',
borderWidth: 1,
marginHorizontal: '3%',
backgroundColor: '#ECECEC',
},
predefinedPlacesDescription: {
color: '#1faadb'
},
container: {
marginHorizontal: '3%',
},
listView: {
borderRadius: 12,
elevation: 1,
},
row: {
backgroundColor: '#ECECEC',
height: 35,
paddingTop: 10,
}
}}
renderRightButton={() =>
<TouchableOpacity onPress={() => navigation.navigate('Profile')}>
<Image
style={{height: 35, width: 35, marginRight: '3%', borderRadius: 36}}
source={{uri: 'https://reactnative.dev/img/tiny_logo.png'}}
/>
</TouchableOpacity>}
/>
</View>
</TouchableWithoutFeedback>
<StatusBar style='auto' />
</Provider>
i tried wrapping mapview and view under touchablewithoutfeedback but that would result in react.children.only expected to receive single react.element.child
i also tried creating another view and wrapped mapview and googleplacesautocomplete in it then wrap that particular view in touchablewithoutfeedback, but still unable to zoom or pitch map
based on the image attached, im not able to pitch or zoom into the map