如何将KML文件插入android mapview?

时间:2011-04-22 01:18:34

标签: android overlay kml

我有一堆kml文件,例如我一直试图作为mapview叠加层插入我的应用程序。我明白我应该解析这个文件以便处理它。但我不确定正确的方法。建议非常感谢。

                                               包括clampToGround             -77.91368,34.04805,-42.6 -77.91372,34.04801,-39.8 -77.91374,34.04796,-38.9 -77.91378,34.04792,-37 -77.91382,34.04788,-36.8 -77.91385,34.04783,-33.2 -77.91387,34.04779,-32.9- 77.91392,34.04775,-32.3 -77.91392,34.04769,-33.1 -77.91393,34.04763,-31.9 -77.91392,34.04758,-31.8 -77.91391,34.04752,-33.7 -77.91391,34.04747,-33.9 -77.91394,34.04742,-31.1 -77.91396 ,34.04737,-29.5 -77.91399,34.04733,-30.3 -77.91404,34.04731,-31.4 -77.9141,34.04731,-31.1 -77.91415,34.04734,-39.5 -77.9142,34.04736,-42.2 -77.91426,34.04736,-43.3 -77.91431, 34.04734,-42.6 -77.91436,34.04731,-36.3 -77.91441,34.04728,-38.4 -77.91446,34.04727,-39.1 -77.91452,34.04726,-36.9 -77.91453,34.04721,-36.4 -77.91449,34.04717,-34.8 -77.91445,34.04714 ,-34.2 -77.91442,34.04709,-33.1 -77.91441,34.04704,-33 -77.91439,34.04699,-31.3 -77.9144,34.04694,-31.3 -77.91438,34.04689,-33.8 -77.91436,34.04683,-32.9 -77.91436,34.04677, -31.2 -77.91432,34.04672,-30.2 -77.91429,34.04668,-29.9 -77.91428,34.04663,-29.2 -77.91428,34.04658,-31.4 -77.914 25,34.04654,-31.4 -77.91424,34.04649,-32.5 -77.91421,34.04643,-31.9 -77.91418,34.04639,-31.5 -77.91415,34.04634,-31.2 -77.9141,34.0463,-30.9 -77.91404,34.04629,-30.3 -77.91398 ,34.04631,-31-77.91391,34.04634,-33.3 -77.91387,34.04637,-34.3 -77.91381,34.04639,-35.2 -77.91375,34.04638,-33.2 -77.91368,34.04637,-32.3 -77.91363,34.04636,-31.9 -77.91358, 34.04635,-32.2 -77.91351,34.04635,-32.2 -77.91345,34.04637,-31.4 -77.91338,34.04635,-30.3 -77.91332,34.04634,-31.3 -77.91326,34.04635,-31.9 -77.91321,34.0464,-33.8 -77.91318,34.04644 ,-33.7 -77.91315,34.04648,-35.5 -77.9131,34.04653,-32.5 -77.91306,34.04656,-33.2 -77.91302,34.04661,-32.8 -77.913,34.04666,-34.5 -77.91297,34.04671,-35.9 -77.91296,34.04676, -34.6 -77.91295,34.04681,-34 -77.91295,34.04687,-36.1 -77.91297,34.04692,-36.5 -77.91298,34.04696,-37.5 -77.913,34.04701,-39 -77.91302,34.04705,-40.1 -77.91304,34.0471, - 38-77.91306,34.04714,-36.5 -77.9131,34.04718,-36.6 -77.91312,34.04723,-35.6 -77.91314,34.04729,-35.2 -77.91313,34.04734,-33.7 -77.9131,34.04738,-32.3 -77.9131,34.04743,-30.7 -77.9131,34.04749,-28.1 -77.91314,34.04754,-26.5 -77.91318,34.04759,-26.5 -77.9132,34.04763,-27.6 -77.91323,34.04768,-29.3 - 77.91324,34.04775,-31             1                                                              FF0000E6             4                                                    曲目       0       1          GPS展示台]]>          1     1   

1 个答案:

答案 0 :(得分:1)

似乎Android框架没有提供帮助来处理这种情况(即在MapView上自动绘制KML文件)。所以你必须手动完成。

要在mapview上绘制路径,您可以参考另一个stackoverflow问题中提供的以下implementation