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 = ?
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;
Please let me know if you can help.