Adding a KML layer to an Android map application

I recently started developing Android in Android, and I'm working on an application that displays a map using the Google API SDK API, this is an almost original example, but a little edited. It works, but I want to do more with it. My question is:

How do you add a KML layer to it? I have not found many examples, and none of them are very clear. I know how to do this with Javascript on sites, but not in android.

Can anyone help?

+3
source share
2 answers

Google recently added KML support to its lib utility. You can create an instance of KMLLayer, as shown below:

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

, (, kml ):

KmlLayer layer = new KmlLayer(getMap(), kmlInputStream, getApplicationContext());

:

layer.addLayerToMap();

Google Maps KML Importing Utility. : Google API Android API ( 0.4 +)

: -. , , - , ..

, .

+4

OpenSteetMap, osmdroid OSMBonusPack, KML : , , .

KML .

+2

Source: https://habr.com/ru/post/1773015/


All Articles