【发布时间】:2022-01-25 16:10:47
【问题描述】:
我在我的 react native 项目中使用这个 Google Places API - https://github.com/FaridSafi/react-native-google-places-autocomplete
我的代码:
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete'
<GooglePlacesAutocomplete placeholder='Search'
query={{key:'',components: 'country:us'}}
onPress={(data, details) => {
//console.log(data.description)
}}
/>
有人知道如何将结果限制为“纽约的餐厅”吗?
谢谢
【问题讨论】:
-
这可能会有所帮助:github.com/AppAndFlow/react-native-google-autocomplete/issues/… 注意 queryTypes 属性。
标签: reactjs react-native google-maps google-places-api