Hi,
I am trying to use the Google Elevation API with the getJSON function of JQuery.
I am using this code which is using JSONP :
jQuery.getJSON("http://maps.googleapis.com/maps/api/elevation/json?locations=23.444,45.4545&sensor=false&jsoncallback=?", function(json){
alert("a");
});
I can see in Firebug that the GET request is correctly send and I receive the correct response from Google :
{
"status": "OK",
"results": [ {
"location": {
"lat": 23.4440000,
"lng": 45.4545000
},
"elevation": 816.7996216
} ]
}
However I never the Alert and I get this error from Firebug :
invalid label
"status": "OK",\n
I am using the Google Maps API v2 so I connato use the build in method.
Is there any way to get the elevation with the Google Elevation API via an AJAX request and without creating a proxy?
Thanks for your help.
Benjamin