【发布时间】:2020-01-04 18:59:02
【问题描述】:
有没有办法将 GooglePlacesAutocomplete 限制为仅进行基本搜索?我的预感是它要么在query 内,要么我需要删除fetchDetails={true} 并只返回数据......我想这样做,所以我不会收取搜索费用。
<GooglePlacesAutocomplete
debounce={200}
listViewDisplayed="auto"
minLength={2}
placeholder="Search..."
autoFocus={false}
returnKeyType={'search'}
fetchDetails={true}
query={{
key: API_KEY,
language: 'en',
types: '(cities)'
}}
styles={{
textInputContainer: {
backgroundColor: 'rgba(0,0,0,0)',
borderTopWidth: 0,
borderBottomWidth:0,
},
textInput: {
marginLeft: 0,
marginRight: 0,
height: 38,
color: '#5d5d5d',
fontSize: 16
},
predefinedPlacesDescription: {
color: 'black'
},
}}
renderDescription={value => value.description}
onPress={(data, details) => {
updateLocationArray(data, details, timeFrame);
}}
/>
【问题讨论】:
标签: react-native google-maps google-maps-api-3