I am building an application in which i am trying to fetch the list of places near to a given lat and long.
i got a api key and entering this on my browser url works and gives me a json file with the places data.
https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&sensor=false&key=AIzaSyAImBQiqvaXOQtqeK8VC-9I96kMmB6Mz7I
but when i try to fetch and parse it though j query its not giving me anything.
$(document).ready(function(){
$.getJSON('https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&sensor=false&key=AIzaSyAImBQiqvaXOQtqeK8VC-9I96kMmB6Mz7I',
function(data) {
alert(data);
});
i found the following questions on stack overflow but they dint reach me to an answer.
parse google place json with javascript
How do I use Google Places to get an array of Place names?
EDIT:
i tried to get contents of the file using php by
echo file_get_contents("https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&sensor=false&key=AIzaSyAImBQiqvaXOQtqeK8VC-9I96kMmB6Mz7I");
and got the file contents using php.
But is there a way to parse this with jquery or javascript ?
Thank you for your help.
Loaded Configuration File C:\wamp\bin\apache\Apache2.2.17\bin\php.ini** i edited the second one. Couldnt locate the first. – Mithun Satheesh Aug 13 '11 at 12:37