Thursday, October 7, 2010

View KML Source from MyMaps

Google MyMaps allows you to export KML by using the "Export to Google Earth" feature. If you copy/paste the URL that this button links to you get a KML, but it is a network reference to the actual KML. If you copy/paste the URL referenced in this KML in your browser, you'll get a warning "{errorText:"Unable to contact server."}". To get past this warning, you must decode the encoded URL reference. That means getting rid of all the "amp;" strings.

For example, change:
http://maps.google.com/maps/ms?ie=UTF8&hl=en&vps=1&jsv=250a&oe=UTF8&msa=0&msid=113097578162956796020.00048fc123b72558b50ff&output=kml

to


and you'll get the actual kml. You do not need to do this within any script or program, since those tend to encode URLs anyway. However, it is very useful for debugging issues with KML.

No comments: