1. 程式人生 > >iOS 對kml檔案內資料進行解析並在地圖上繪製(二)

iOS 對kml檔案內資料進行解析並在地圖上繪製(二)

這是我寫好的demo, 有解析工具和資料解析的思路. 提供一個參考!

kml檔案其中的一種格式, 如下展示的

<Placemark>
        <name>001</name>
        <LineString>
            <extrude>1</extrude>
            <tessellate>1</tessellate>
            <altitudeMode>relativeToGround</altitudeMode>
<coordinates>121.4293828,31.14503434,0.000 121.4293843,31.14505119,0.000 121.4294429,31.1450459,0.000 121.4294405,31.14502915,0.000 </coordinates> </LineString> </Placemark> <Placemark> <name>
002</name> <LineString> <extrude>1</extrude> <tessellate>1</tessellate> <altitudeMode>relativeToGround</altitudeMode> <coordinates>121.4294405,31.14502915,0.000 121.4294429,31.1450459,0.000 121.4295036,31.14503995,0.000 121.4295004,31.14502314,0.000 </coordinates
>
</LineString> </Placemark>

之後繪製圖形如圖
這裡寫圖片描述