A few questions & a compliment

May 15, 2012 at 4:39 PM
Edited May 15, 2012 at 4:48 PM

First off.. Amazing library you have created. It has provided me with some amazing tools for dealing with KML/KMZ data.

I am trying to create a KML from some data I have collected from various sources. I'll post my code below.

I have one issues currently:

-I am having trouble getting an icon to show up for each placemark.

 

private void createKML(string dir)
        {
            string file = dir + "\\index.kml";
            Document doc = new Document();
            Kml kml = new Kml();

            Style style = new Style();
            style.Id = "style1";
            style.Icon = new IconStyle();
            style.Icon.Icon = new IconStyle.IconLink(new Uri("http://maps.google.com/mapfiles/kml/pal2/icon56.png"));
            style.Icon.Scale = 1.0;
            style.Icon.Hotspot.X = 20;
            style.Icon.Hotspot.Y = 10;
            //style.Icon.Hotspot.XUnits = ? 
            doc.AddStyle(style);

            for(int i = 0; i < malLat.Count; i++)
            {
                Placemark placemark = new Placemark();
                placemark.Name = malTimes[i].ToString();

                placemark.StyleUrl = new Uri("#style1", UriKind.Relative);
                Point point = new Point();
                point.Coordinate = new Vector(double.Parse(malLat[i].ToString()), double.Parse(malLong[i].ToString()));
                placemark.Geometry = point;

                doc.AddFeature(placemark);
            }
}

Please let me know if you can help.
Thanks, Kevin
May 15, 2012 at 4:50 PM

All my problems are solved! No assistance required!

Coordinator
May 15, 2012 at 6:07 PM

Glad you managed to fix it, though out of curiosity how did you fix the problem in case others encounter it as well?