【问题标题】:Filtering Google Places API results by keyword按关键字过滤 Google Places API 结果
【发布时间】:2016-01-15 03:55:24
【问题描述】:

我想按关键字过滤 Google Places API 结果。它目前支持“健身房”类型,但我想获得更具体的类型,例如“瑜伽”或“拳击”。如何在我的代码中实现这一点?

function search() {
  var search = {
    bounds: map.getBounds(),
    types: ['gym']
  };


    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=API_KEY&signed_in=true&libraries=places&callback=initMap"
        async defer></script>

【问题讨论】:

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


    【解决方案1】:

    Place Types 不能像你想要的那样深入/定义。

    【讨论】:

      【解决方案2】:

      将特定术语添加为keyword(假设这是一个附近搜索请求,对于文本搜索,请将其添加到query):

      var search = {
        keyword: 'boxing',
        bounds: map.getBounds(),
        types: ['gym']
      };
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-02-18
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多