Krrish
Krrish

Reputation: 281

How to load a KML/KMZ file in google maps android?

Is there any way to load the KML file and display the map location according to the KML file design in android application using google maps if possible can some one please guide me to do so.

Thank you.

Upvotes: 3

Views: 8973

Answers (1)

wrldbt
wrldbt

Reputation: 191

Google has a beta utility library for doing this, which can be found here:

https://developers.google.com/maps/documentation/android/utility/kml

If you have the library imported all you need to do is

KmlLayer layer = new KmlLayer(getMap(), R.raw.kmlFile, getApplicationContext()); 
layer.addLayerToMap();

Assuming you have the Google Maps object and a local kml file in your raw folder.

Upvotes: 5

Related Questions