Open local KML File in Google Maps on Android

ahsteele picture ahsteele · May 28, 2010 · Viewed 86k times · Source

I have loaded a KML file onto an Android device. What's the easiest mechanism for loading an overlay of that KML file into Google Maps? I do not want to upload the KML file to the web but would rather open it locally.

Answer

gb96 picture gb96 · Aug 26, 2011

To load kml into Google Maps on Android without writing an app, you can create a little html file somewhere with a geo-uri link to the kml file and then click on that link in any Android web browser.

For example: suppose your kml file is located in /sdcard/overlay.kml then you write a geo-uri link like this:

<html>
<head><title>Example KML link page using a geo-uri</title></head>
<body>
  <a href="geo:0,0?q=file:///sdcard/overlay.kml">overlay.kml</a>
</body>
</html>

Clicking on the link will launch Maps and then Maps will attempt to load and your kml.

(Obviously if your kml file is on a web server the file:// part can be replaced with http:// servername)

Be warned however that the Android version of Maps does not appear to handle the same version/range of kml elements as the desktop version (or desktop Google Earth).