2016-06-24 46 views
0

我正在爲這個http調用foursquare API,如果我使用'll'參數,我沒有得到任何結果。只要我刪除它並輸入'near:10011',我就會得到結果。我究竟做錯了什麼?我需要使用緯度經度。Foursquare API緯度經度不返回結果

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'} 
     }); 

回答

0

嘗試刪除座標周圍引號像ll: 44.3,37.2

+0

工作正常!謝謝! – blueberry

0

你應該解決返回的承諾:

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();