Using SharpKML library from VB (VS2010), I can create kml files with a custom icon for each placemark. The placemarks are created in a loop and I want to set the icon's heading property for each placemark.
'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
Can anybody help me set the icon heading for an individual placemark using SharpKML?