How to plot a pre-build map from google maps on a MapView

前端 未结 3 660
梦毁少年i
梦毁少年i 2021-01-23 17:00

I\'m trying to read a map from a link (http://maps.google.com/maps/ms?msid=216892338463540803496.000494dd57eb5ebce6db2&msa=0) and plot it on a MapView, is it possible?

3条回答
  •  囚心锁ツ
    2021-01-23 17:50

    As you posted more information in my previous answer ("but I don't want to parse the KML and plot point by point. I was wondering if theres a way to plot all at once"), I can now redifine my answer.

    You should try these lines and adapt it to your needs:

    Intent mapIntent = new Intent(Intent.ACTION_VIEW); 
    Uri uri1 = Uri.parse("geo:0,0?q=http://code.google.com/apis/kml/ 
    documentation/KML_Samples.kml"); 
    mapIntent.setData(uri1); 
    startActivity(Intent.createChooser(mapIntent, "Sample")); 
    

    Unfortunately, you won't have any control, as this is not a MapActivity. If you plan to add more stuff on your map, you have to try my first proposal and parse yourself the kml!

    Similar question: How to use kml file on mapView in Android

提交回复
热议问题