【问题标题】:How to fetch Sports Complexes and Fields in Google Places API?如何在 Google Places API 中获取运动场馆和场地?
【发布时间】:2019-10-05 08:53:03
【问题描述】:

我想获取综合运动场/运动场甚至公寓,我该如何获取? 目前我在自动完成中得到的结果很少。

包名: react-native-google-places-autocomplete .
API: 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.

【问题讨论】:

    标签: google-maps google-places-api googleplacesautocomplete


    【解决方案1】:

    很遗憾,当前的 API 无法访问此功能。目前支持的类型列表可以在here找到。

    但是,您可以添加

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

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

    【讨论】:

      【解决方案2】:

      目前似乎还不支持“sports_complex”类型。但是,如果您确实需要在我们的 API 中添加此功能,您可以在我们的Google Public Issue Tracker 中提出功能请求。

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

      非常感谢!

      【讨论】:

        猜你喜欢
        • 2017-02-04
        • 1970-01-01
        • 2022-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-10-27
        相关资源
        最近更新 更多