I have similar issue in my application.
when i browse following url, I'll get the correct xml output.
http://maps.google.com/maps/geo?q=Jönköpings&output=xml&key=AIzaSyDCJFd_FXZ1A_iifGE81W2cgQtTJPI69h0&hl=en

But when i use curl, i get the error 400 as the out put.

$geourl="http://maps.google.com/maps/geo?q=Jönköpings&output=xml&key=AIzaSyDCJFd_FXZ1A_iifGE81W2cgQtTJPI69h0&hl=en";;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $geourl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$geoxml = simplexml_load_string($output) or die("XML string not loading");

Response:
<?xml version="1.0" encoding="UTF-8" ?><kml xmlns="
http://earth.google.com/kml/2.0";><Response> <name>Jönköpings</name> <Status> 
<code>400</code> <request>geocode</request> </Status></Response></kml>

Can anyone help me on this issue?

Thanks.

Derick





On Thursday, December 18, 2008 3:41:54 PM UTC+5:30, Econym [Maps API Guru] 
wrote:
>
> KML returns the results in Lng/Lat order, but the geocoder expects the 
> input in Lat/Lng order.
>
> Google can't reverse geocode points that are further North than 90 
> degrees. "400" might not be the most meaningful error in such 
> circumstances, but you're certainly not going to get success.
>
> [This was a bad design decision made by KeyHole, many years ago. Google 
> switched the order for internal purposes when APIv2 was introduced, but 
> it was too late to make a significant change to the KML specification.]
>
> -- 
> http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-api/-/Odl_lIQRsMMJ.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to