如何获取范围内的Facebook位置列表 [英] How can I get list of Facebook places inside bounds

查看:121
本文介绍了如何获取范围内的Facebook位置列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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

  FB.api({
method:fql.query,

query: SELECT名称,描述,几何,纬度,经度,checkin_count,display_subtext FROM place WHERE纬度<'+ bounds.getNorthEast()。lat()+'和经度<'+ bounds.getNorthEast() ()+'和纬度>'+ bounds.getSouthWest()。lat()+'和longitude>'+ bounds.getSouthWest()。lng()+'
}
函数(响应){
///
}

但是我收到错误604

 您的语句不可索引WHERE子句必须包含可索引列,这些列标有*在http://developers.facebook.com/docs/reference/fql链接的表中

As就像我可以一样e是地方唯一索引的列 http://developers.facebook.com/docs/reference/fql/place/ page_id 。但是我没有办法从其他表中获取这个 page_id



有没有(也许更简单)方式在特定范围内接收Facebook的位置?

解决方案

我用fql做了这个,我受到了这个答案的启发: >

Facebook地点:订单结果距离



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

  FB.api({
method:fql.query,
query:SELECT page_id,name,description,latitude,经度,checkin_count,距离(纬度,经度,'+ centerlat +','+ centerlon +')FROM where WHERE distance(纬度,经度,'+ centerlat +, )<'+ distance +'
},
函数(响应){

});

它完全符合我所需要的 - 给我可以使用的地方列表。 p>

I need to receive list of facebook places inside of given bounds (defined by NE and WS coordinates)

I call the following fql.query from javascript application:

 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) {
     /// 
 }

But I receive error 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 

As far as I can see the only indexed column in place table http://developers.facebook.com/docs/reference/fql/place/ is page_id. But I see no means to get this page_id from some other table.

Is there any (maybe more simple) way to receive facebook places within given bounds?

解决方案

I made it with fql, I was inspired by this answer:

Facebook places: order results by distance

I searched not within bounds, but within distance from central point, but using the fql.query language:

    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) {

      });

And it does exactly what I need - gives me the list of places which I can use.

这篇关于如何获取范围内的Facebook位置列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆