如何在 Google 地方信息接口中获取体育场馆和场地?



我想去体育馆/场地甚至公寓,我怎么能得到呢? 目前,我在自动完成中得到的结果很少。

包装名称:react-native-google-places-autocomplete.
原料药:GooglePlacesAutocomplete

<GooglePlacesAutocomplete
query={{
// available options: https://developers.google.com/places/web-service/autocomplete
key: ,
language: "en", // language of the results
types: "address" // default: 'geocode'
}}
nearbyPlacesAPI="GooglePlacesSearch" // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch
GoogleReverseGeocodingQuery={
{
// available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro
}
}
GooglePlacesSearchQuery={{
// available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search
rankby: "distance"
}}
filterReverseGeocodingByTypes={[
"locality",
"administrative_area_level_3"
]} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities
// predefinedPlaces={[homePlace, workPlace]}
debounce={200} // debounce the requests in ms. Set to 0 to remove debounce. By default 0ms.
/>

filterReverseGeocodingByTypes是我应该照顾的事情,但我不确定如何获得所有的体育场馆、场地和公寓。

如果我能得到所有的结果,就像我们在谷歌地图中得到的那样,那也很好。

示例City, Locality, Schools and everything.

不幸的是,当前 API 无法访问此功能。可在此处找到当前支持类型的列表。

但是,您可以添加

GooglePlacesSearchQuery={{
// available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search
rankby: 'distance',
type: 'stadium' 
}}

将类型指定为stadium是最接近获取体育场馆和场地的方法,但结果不会 100% 准确。

目前似乎尚不支持"sports_complex"类型。但是,如果您确实需要在我们的 API 中添加此功能,您可以在我们的Google 公共问题跟踪器中提交功能请求。

问题跟踪器是 Google 内部使用的一种工具,用于在产品开发过程中跟踪错误和功能请求。它可在 Google 外部使用,供需要与 Google 团队就特定项目进行协作的外部公众用户和合作伙伴用户使用。

谢谢!

最新更新