My attempts to utilize Google's Places API in order to retrieve nearby locations have hit a roadblock. I initially tried adding the header exactly as outlined in the code, but it proved ineffective. Subsequently, I experimented with dataType:'jsonp'
, however, this approach resulted in some errors. Upon examining the error within Chrome, I noticed that the data was successfully returned from Google, yet I encountered issues accessing it. Interestingly, Firefox presented only the second line of the data "html_attributions":[],
" instead of displaying the entire dataset.
$.ajax({
url : "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=13.089500428429146,77.48688038438559&radius=1000&type=bus_station&key=AXXXXXXXXXXXXXXXXXXXXXXX",
type:"GET",
//headers:{"Access-Control-Allow-Origin":"https://maps.googleapis.com/"},
dataType: 'jsonp',
success: function (return_data_json){
console.log(return_data_json);
}
});