This project has moved and is read-only. For the latest updates, please go here.

Using StyleSelector

Aug 30, 2010 at 10:22 AM
Edited Aug 30, 2010 at 10:35 AM

Interesting project.

I want to use it to dinamically generate kml, but I'm having trouble setting a custom Feature icon.

I found the class SharpKml.Dom.IconStyle.IconLink that have a URL proprieties, but is an internal class with no public constructor ...

Someone can post some a small example to generate kml ?



Aug 30, 2010 at 2:43 PM
Edited Aug 30, 2010 at 2:44 PM

You're right! You should be able construct the class as you need a way of setting the link to the icon!

The class is a bit of an oddball as it's nested inside the IconStyle class, as this was the way it's declared in the XSD. Originally I wanted to simply replace it with a URI, as the reference states that the only valid member is a href attribute, however, libkml (the C++ version from Google) also has some size information about the Icon so this was changed. Unfortunately, the constructor wasn't changed to public (the unit tests have the InternalsVisibleTo attribute set so this wasn't picked up.)

I'll file an issue and post the updated files today, along with an example.

Thanks for your feedback.

Aug 30, 2010 at 6:30 PM

This has now been fixed and there's a simple example in the CreateIconStyle.cs file in the Examples folder.

Hope it helps!

Aug 30, 2010 at 6:46 PM

MANY THANKS .. verified and it works!

Thanks for the rapidity and also for the example, its a valuable resource!

Best regards !