There is a map created in the new Google maps engine editor. Now the map needs to be exported as KML using Curl. Previous version of the maps editor (now called "MyPlaces" or "My Maps classical version") allows export the map by ID using this template for URL:
https://maps.google.com/maps/ms?oe=UTF8&hl=ru&msa=0&msid=${ID}&output=kml
New map ID neither looks like the old one (zv44oKISEgzs.kzcf044WEB9o
vs 107197571518206937258.000453b7c5de92024cf27
respectively), nor it does fit the export API. Google responds with 200 OK but with empty response body.
Is there any similar API call in the new Maps Engine to get the map exported as KML with just a line of shell?
Found, thanks to all :)
First, make the map public in the Google Map Engine web application:
Then you can easily download this map as KML using this URL template:
https://mapsengine.google.com/map/kml?mid=${ID}
UPDATE: Google started sending the KML file as KMZ. Don't panic, KMZ is just a zip archive of single KML file. To fix the algorithm just add funzip
tool (apt-get install unzip
) in the end of shell pipe like this:
curl -s 'https://mapsengine.google.com/map/kml?mid=${ID}' | funzip
Or use an unzip library native to your language. Keep having fun with Google API updates!