使用rest api的Parse.com GeoQueries总是返回空数组

时间:2014-10-29 09:34:31

标签: parse-platform geopoints

我想根据用户位置加载详细信息。当我查询结果时,它总是返回空数组。该怎么办? 这是我的问题:

https://api.parse.com/1/classes/TSLocation?where{"location":"{\"nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":34.944251,\"longitude\":-111.753343}}","limit":10}

我还添加了标头和HttpRequest。如果有人知道,你能指导吗

2 个答案:

答案 0 :(得分:2)

最后我明白了......实际上我的查询错了。在上面的位置查询我传递的是JsonString而不是JSONObject。

格式化查询是: https://api.parse.com/1/classes/TSLocation?where= {"位置" {" $ nearSphere" {" __类型":"的GeoPoint""经度& #34;: - 74.00594130000002,"纬度":40.7127837}}}&安培;限制= 10

答案 1 :(得分:0)

$ nearSphere而不是nearSphere,试试这个

https://api.parse.com/1/classes/TSLocation?where{"location":"{\"$nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":34.944251,\"longitude\":-111.753343}}"}&limit=10
相关问题