我正在使用Parse JavaScript SDK来查询我的一个表,而使用withinKilometers的函数每次都给我500个错误。我似乎无法理解为什么。看一下文档,看起来我正确地使用了公里。这是功能:
function getPickupPointsInCircle() {
// initialization call
Parse.initialize(some_key, some_other_key);
// table and query
var Table = Parse.Object.extend(pickupTable);
var query = new Parse.Query(Table);
var point = new Parse.GeoPoint(40.73555, -74.00425);
var radius = 1.00364;
query.withinKilometers("pickup_location", point, radius);
// results
query.find({
success: function(results) {
var res = "Number of pickup points: " + results.length + "\n";
for(i = 0; i < results.length; i++)
res += results[i].get("pickup_location").longitude+", "+results[i].get("pickup_location").latitude + "\n";
alert(res);
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});
}