Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:19:33+00:00 2026-06-17T23:19:33+00:00

Using SharpKML library from VB (VS2010), I can create kml files with a custom

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:19:34+00:00Added an answer on June 17, 2026 at 11:19 pm

    The Heading is actually a property of IconStyle and not Icon (Icon is a child property of IconStyle and only specifies the URL to the icon image.

    In your code above it would be (from memory):

    kmlStyle.Icon.Heading = 90;
    

    Because you are using a common style for all items I believe you can override just parts of a Style like this inside your loop (please post the result if you test):

    kmlPosPlaceMark.StyleUrl = New System.Uri("#ShipIcon", UriKind.Relative);
    Style s = new Style();
    s.Icon = new IconStyle();
    s.Icon.Heading = 90;
    kmlPosPlaceMark.StyleSelector = s;
    

    If that doesn’t work you might have to create and set a style per Placemark, but i am pretty sure that is not the case. Again, please post back and let us know how you make out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CMake I want to check if a particular function (cv::getGaborKernel) from OpenCV library
Using CSS, how can I create a partial border as per image below I
Using Java, how can I extract all the links from a given web page?
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
using phpPgAdmin, I've tried to create a table in my database. But am getting
Using GPS, how can I notify a cab operator in the area if I
Using Apache's RewriteRule, how can I make it serve: mydomain.com/webpage.php?name=home_page as simply: mydomain.com/ Without
Using C# How can I show a document in richtextbox without scrollbars, But I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.