AngularJS和Parse.com之间的地质点查询错误代码:1
嘿,我一直在使用Parse.com作为我正在开发的angularjs web应用程序的后端,最近我遇到了一些地质点查询问题。我试图通过下面的$http查询获得数据库中10个最近场馆的列表AngularJS和Parse.com之间的地质点查询错误代码:1,angularjs,parsing,parse-platform,geopoints,Angularjs,Parsing,Parse Platform,Geopoints,嘿,我一直在使用Parse.com作为我正在开发的angularjs web应用程序的后端,最近我遇到了一些地质点查询问题。我试图通过下面的$http查询获得数据库中10个最近场馆的列表 $http({method:'GET', url: 'https://api.parse.com/1/classes/Venue', params: { limit:10, where:{"GeoLocation":{"$nearSphere": {"__type":"GeoPoint",
$http({method:'GET',
url: 'https://api.parse.com/1/classes/Venue',
params: { limit:10, where:{"GeoLocation":{"$nearSphere": {"__type":"GeoPoint","latitude":40.730669, "longitude":-74.063631}}}},
isArray:true,
headers: {'X-Parse-Application-Id':'XXXXXXXX',
'X-Parse-REST-API-Key':'YYYYYYYYY',
}
});
每次我收到错误代码:1个来自解析的内部错误响应。我已经按照建议联系了parse.com,但他们的响应速度并不是最快的。我想知道是否有其他人遇到了这个问题,并找到了解决方案。提前感谢如果您将地理位置字符串化,那么它应该可以工作
var geocodeObj, paramsObj;
geocodeObj = {
"Geolocation": {
"$nearSphere": {
"__type": "GeoPoint",
"latitude": 40.730669,
"longitude": -74.063631
}
}
};
paramsObj = {
"limit": 10,
"where": JSON.stringify(geocodeObj)
};
$http({
"method": "GET",
"url": "https://api.parse.com/1/classes/Venue",
"params": paramsObj,
"isArray": true,
"headers": {
"X-Parse-Application-Id": "xxx",
"X-Parse-REST-API-Key": "xxx",
"Content-Type": "application/json"
}
}).success(function(data, status, headers, config) {
}).error(function(data, status, headers, config) {
});