Google Maps output=kml broken?

mbh picture mbh · Jul 27, 2012 · Viewed 12.6k times · Source

All

I was using the google maps KML output in my iPhone app. If I type the following on my browser, it used to give an option to save the kml file:

http://maps.google.com/maps?q=restaurant&mrt=yp&num=10&sll=37.786945,-122.406013&radius=5&output=kml

But all of a sudden today, it is returning an html file. What happened? any ideas? I use it in my iPhone app and it is throwing error as it is not a valid xml returned. Obviously....

Thanks, mbh

Answer

Hesham Saeed picture Hesham Saeed · Jul 31, 2012

This way of extracting the Google Directions from Google by parsing the KML file is no longer available since 27 July 2012 (because Google has changed the structure of retrieving Google Directions, now you can only get it by JSON or XML), it is time to migrate your code to JSON instead of KML.

See the answer (for Android only but maybe for iPhone can understand the algorithm and apply it) in my own question here.