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

How to add a KML Model feature

Apr 12, 2014 at 7:09 AM
Edited Apr 12, 2014 at 7:11 AM
Your library is a tremendous help. I've been able to use it to do some simple KML work quite quickly. Unfortunately, I'm new to KML and XML in general and am struggling to move on to slightly more complex tasks. For example, I can't figure out how to add a KML Model to a Placemark. I've copied a KML file with a Model that I hand typed in Notepad that does seem to work in GE but I'd like to build and change this KML file programmatically using SharpKML as I read new locations for the model from a GPS receiver. I can build the Placemark by itself but haven't figured out how to add the model elements.

Thanks for the library and any help you can provide will be greatly appreciated.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
            <Style id="default">
            <Model id="model_5">
Apr 12, 2014 at 9:55 AM
Thanks for the kind words!

Looking at the Model reference towards the bottom it mentions it extends the Geometry type, so you should be able to assign the Model you created to the Geometry property of the Placemark class.

Hope it helps,
Apr 12, 2014 at 6:37 PM
A great library and instantaneous support, it doesn't get any better than that. Once you pointed me in the right direction, it only took a little more fumbling around on my part to get everything working.

Many thanks - Gene