四方 API 纬度经度不返回结果



我正在为foursquare API进行此HTTP调用,如果使用'll'参数,我将不会获得任何结果。一旦我将其删除并输入"接近:10011",我就会得到结果。我究竟做错了什么?我需要使用纬度经度。

var data = $http({
      url: 'https://api.foursquare.com/v2/venues/explore',
      method: 'jsonp',
      params: {query: selectedQuery, limit:7, ll: '44.3,37.2', client_id: clientId, client_secret: clientSecret, price: selectedPrice.priceValue, v: 20140806, callback: 'JSON_CALLBACK'}
      });

尝试删除像 ll: 44.3,37.2这样的坐标周围的引号。

您应该解决返回的承诺:

var data = function () {
 return $http({
   url: 'https://api.foursquare.com/v2/venues/explore',
   method: 'jsonp',
   params: {query: selectedQuery, limit:7, ll: '44.3,37.2', client_id: clientId, client_secret: clientSecret, price: selectedPrice.priceValue, v: 20140806, callback: 'JSON_CALLBACK'}
 }).then(function success (response) {
     return response; 
    }, 
    function error (response) {
     return response;
    });
//Call the function 
data();

最新更新