0

我需要接收给定范围内的 facebook 位置列表(由 NE 和 WS 坐标定义)

我从 javascript 应用程序调用以下 fql.query:

 FB.api({
    method: "fql.query",

    query: "SELECT name,description,geometry,latitude,longitude,checkin_count,display_subtext FROM place WHERE latitude < '" + bounds.getNorthEast().lat() + "' and longitude < '" + bounds.getNorthEast().lng() + "' and latitude > '" +  bounds.getSouthWest().lat() + "' and longitude > '" +  bounds.getSouthWest().lng() +"'"
  },
  function(response) {
     /// 
 }

但我收到错误 604

Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql 

据我所知,placehttp://developers.facebook.com/docs/reference/fql/place/中唯一的索引列是page_id. 但我看不出有什么办法可以page_id从其他桌子上得到这个。

有没有(可能更简单)的方式来接收给定范围内的 facebook 位置?

4

2 回答 2

2

你是对的,因为这些列没有被索引,所以不能使用 FQL 表。
但是您可以尝试调用 Graph API 来搜索特定位置内的地点。
例如 - https://graph.facebook.com/search?type=place¢er=37.76,-122.427&distance=1000&access_token= ...
这来自此处的 Graph API 文档 - https://developers.facebook.com/docs/参考/api/

于 2012-08-28T23:01:57.593 回答
0

我是用 f​​ql 做的,我受到这个答案的启发:

Facebook 地点:按距离排序结果

我不是在界限内搜索,而是在距离中心点的距离内搜索,而是使用 fql.query 语言:

    FB.api({
      method: "fql.query",
      query: "SELECT page_id, name, description, latitude, longitude, checkin_count, distance(latitude, longitude, '"  + centerlat + "', '" + centerlon + "') FROM place WHERE distance(latitude, longitude, '" + centerlat + "', '" + centerlon + "') < '" + distance +"'" 
      },
      function(response) {

      });

它正是我需要的——给了我可以使用的地方列表。

于 2012-08-29T09:45:58.757 回答