使用 VB (VS2010) 中的 SharpKML 库,我可以为每个地标创建带有自定义图标的 kml 文件。地标是在循环中创建的,我想为每个地标设置图标的标题属性。
'Define the style for the icon
Dim kmlStyle As New SharpKml.Dom.Style
kmlStyle.Id = "ShipIcon"
kmlStyle.Icon = New SharpKml.Dom.IconStyle
kmlStyle.Icon.Icon = New SharpKml.Dom.IconStyle.IconLink(New System.Uri("http://www.mysite.com/mapfiles/ship4.png"))
kmlStyle.Icon.Scale = 1
Poscommand.CommandText = "SELECT * FROM Ships"
PosReader = Poscommand.ExecuteReader()
While PosReader.Read()
'Add placemark for position
kmlPosPoint = New SharpKml.Dom.Point
kmlPosPoint.Coordinate = New SharpKml.Base.Vector(PosReader("Lat"), PosReader("Lon"))
kmlPosPlaceMark = New SharpKml.Dom.Placemark
kmlPosPlaceMark.Geometry = kmlPosPoint
kmlPosPlaceMark.Name = "My Name"
kmlPosPlaceMark.StyleUrl = New System.Uri("#ShipIcon", UriKind.Relative)
'SET icon.heading HERE??? How to access icon heading property for this placemark only???
End While
任何人都可以帮助我使用 SharpKML 为单个地标设置图标标题吗?