gpt4 book ai didi

android - 如何将KML文件插入android mapview?

转载 作者:行者123 更新时间:2023-11-30 04:42:20 25 4
gpt4 key购买 nike

我有一堆这样的kml文件,我一直试图将它们作为mapview叠加层插入到我的应用程序中。我了解我应该解析此文件以便处理它。但是我不确定执行此操作的正确方法。建议非常感激。



  
    
      
        
          
            clipToGround
            -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 Visualizer]]>
    
    1个
    1个

最佳答案

似乎Android框架没有提供帮助来处理这种情况(例如,在MapView上自动绘制KML文件)。因此,您必须手动进行操作。

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

关于android - 如何将KML文件插入android mapview?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5751442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com