0

在我的iOS应用程序中,我在数据库中有 20000 条记录,SQLite其中包含位置数据城市、纬度、经度、国家、州、邮编等。如何KML使用这些数据创建文件以将视觉效果应用于地图视图中的地图?

4

2 回答 2

0

我使用这个库进行 KML 解析:https ://github.com/FLCLjp/iOS-KML-Framework 。它功能非常全面,并且易于扩展。

它还可以根据您的需要生成 KML 文件,尽管我还不需要使用它。KMLPlacemark 类是您为数据创建地标所需的类。

有关 KML 标准的详细信息,请参阅 Google KML 参考:https ://developers.google.com/kml/documentation/kmlreference

于 2012-07-30T12:40:13.157 回答
0

您可以创建一个方法来读取您拥有的位置数据,然后使用 KML 标签包装这些数据。例如,这是制作地标的代码:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Placemark>
    <name>Simple placemark</name>
    <description>Attached to the ground. Intelligently places itself 
       at the height of the underlying terrain.</description>
    <Point>
      <coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
    </Point>`
  </Placemark>
</kml>

以同样的方式,您可以将数据包装成显示线或曲面。在这里您可以找到更多https://developers.google.com/kml/documentation/kml_tut

于 2017-05-07T11:42:57.647 回答