【发布时间】:2019-01-23 01:54:06
【问题描述】:
我有一个 kml 文件:
在地图工具包上显示来自 kml 文件的所有数据后,一切正常。但在 kml 文件中我无法显示图标。
这是一个注释代码:
open class KMLDocument: KMLElement {
open var overlays: [MKOverlay] = []
open var annotations: [KMLAnnotation] = []
open var styles: [String: KMLStyle] = [:]
open var placemarks: [KMLPlacemark] = []
public convenience init(_ element: AEXMLElement, generateMapKitClasses: Bool) {
self.init(element)
if generateMapKitClasses {
initOverlay()
initAnnotation()
}
}
fileprivate func initAnnotation() {
for pointPlacemark: KMLPlacemark in placemarks {
if let point: KMLPoint = pointPlacemark.point {
let annotation = KMLAnnotation(point.coordinates)
annotation.title = pointPlacemark.name
annotation.subtitle = pointPlacemark.description
annotation.style = pointPlacemark.style
self.annotations.append(annotation)
}
}
}
}
【问题讨论】: