【问题标题】:Cannot find POI via google-places-api that can be found on google-maps and google-plus无法通过可在 google-maps 和 google-plus 上找到的 google-places-api 找到 POI
【发布时间】:2014-07-16 15:32:25
【问题描述】:

我正在尝试通过 google-maps-places API 查找特定列表,但没有得到任何结果。这对我来说很奇怪,因为有一个 Google+ 页面和一个 google-maps 条目。

让我们看一下链接:

谷歌+: https://plus.google.com/115673722468988785755/about

地图: https://www.google.de/maps/place/AMWAY+Beratung+%26+Vertrieb+Haegebarth/@53.171976,9.465828,17z/data=!3m1!4b1!4m2!3m1!1s0x47b106116fc69d69:0xe17811ab2780c71d

如果我在附近的搜索中使用地图条目中的相同坐标,并使用条目中的名称作为关键字(或位置作为关键字),则结果为空。

Places-API(坐标完全相同): https://maps.googleapis.com/maps/api/place/nearbysearch/json?sensor=false&radius=2000&name=amway&location=53.171976,9.465828&language=de-DE&key=YOURKEY

我当然可以想象 Google+ POI 的数据库是不同的。但话又说回来,我看不到 maps api 如何找不到我可以在 maps web 应用程序上找到的内容。

非常感谢您的帮助!

【问题讨论】:

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


    【解决方案1】:

    试试这样的:

    map.places.nearbySearch({
      location: latLng,
      rankBy: google.maps.places.RankBy.DISTANCE,
      types: ['shop'], // optional
      name: "AMWAY Beratung & Vertrieb Haegebarth" // optional
    },function(results, status){
      if (status == google.maps.places.PlacesServiceStatus.OK) {
    
        // The thing you need should be result[0]
        // console.log(results[0]);
        if (results[0].name == "AMWAY Beratung & Vertrieb Haegebarth") { // optionally check the type
    
          // You have your place :)
    
        }
      }
    }
    

    什么解决方法!有传言说 Google Maps JS API v3.20 或更高版本将允许我们在 POI 上触发点击事件,从而直接获取 Place 对象。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-12
      • 2023-02-13
      • 2017-08-02
      • 2014-02-18
      • 2020-05-11
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多