public static KmlHelper StartKmlWriting() { KmlHelper kmlWriter = new KmlHelper(); AddKmlStyle(kmlWriter); return(kmlWriter); }
private static void AddKmlStyle(KmlHelper kmlWriter) { XmlNode node = kmlWriter.AddStyle(_DefStyle); kmlWriter.AddStylePoly(node, 2, _DefColor, false); kmlWriter.AddIconStyle(node, new Uri("http://maps.google.com/mapfiles/kml/paddle/wht-blank.png")); }
public void ExportToKml(String fileName) { KmlHelper kmlWriter = StartKmlWriting(); WriteToKml(kmlWriter, kmlWriter.DocumentNode, Name); kmlWriter.SaveToFile(fileName); }
public void WriteToKml(KmlHelper kmlWriter, XmlNode node, String description) { List <GeoPoint> border = new List <GeoPoint>(); border.Add(NorthWestCorner); border.Add(NorthEastCorner); border.Add(SouthEastCorner); border.Add(SouthWestCorner); border.Add(NorthWestCorner); kmlWriter.AddPolygon(node, border, Name, _DefStyle, description, true); }
private void btnFlyTo_Click(object sender, EventArgs e) { try { var googleEarth = new ApplicationGEClass(); String tempKmlFile = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".kml"; KmlHelper kmlWriter = new KmlHelper(); kmlWriter.AddPoint(_Point.Latitude, _Point.Longitude, "Temporary location", "", "", ""); kmlWriter.SaveToFile(tempKmlFile); while ( googleEarth.IsInitialized() == 0 ) { Thread.Sleep(500); } googleEarth.OpenKmlFile(tempKmlFile, 0); } catch ( Exception ex ) { MessageBox.Show(ex.ToString()); } }
public void WriteToKml(KmlHelper kmlWriter, XmlNode node, String description) { List<GeoPoint> border = new List<GeoPoint>(); border.Add(NorthWestCorner); border.Add(NorthEastCorner); border.Add(SouthEastCorner); border.Add(SouthWestCorner); border.Add(NorthWestCorner); kmlWriter.AddPolygon(node, border, Name, _DefStyle, description, true); }
public static KmlHelper StartKmlWriting() { KmlHelper kmlWriter = new KmlHelper(); AddKmlStyle(kmlWriter); return kmlWriter; }
internal void AddToKml(KmlHelper iKml, XmlNode iNode, String lEntityName, String iDescription) { if (Location != null) { String lName = OfficeNameEnglish[Type] + ' ' + lEntityName; String lAddress = String.Empty; if (Address != null) { lAddress = Address.ToString(); } // ToDo: for Amphoe also amphoe.com URL to description String lDescription = iDescription; foreach (Uri lUri in this.Websites) { lDescription = lDescription + Environment.NewLine + lUri.ToString(); } iKml.AddPoint(iNode, Location.Latitude, Location.Longitude, lName, Type.ToString(),lAddress,lDescription); } }
internal static void AddKmlStyles(KmlHelper iKml) { foreach (KeyValuePair<OfficeType, String> lKeyValuePair in OfficeKmlStyles) { iKml.AddIconStyle(lKeyValuePair.Key.ToString(), new Uri(lKeyValuePair.Value)); } }
public void ExportToKml(String iFilename) { KmlHelper lKmlWriter = new KmlHelper(); EntityOffice.AddKmlStyles(lKmlWriter); WriteToKml(lKmlWriter, lKmlWriter.DocumentNode); lKmlWriter.SaveToFile(iFilename); }
private void WriteToKml(KmlHelper lKmlWriter, XmlNode iNode) { XmlNode lNode = iNode; String lDescription = "Geocode: " + Geocode.ToString(); if ( (Type == EntityType.Changwat) | (Type == EntityType.Bangkok) ) { lNode = lKmlWriter.AddFolder(lNode, English, false); } String lName = English; if ( Type == EntityType.Muban ) { lName = "Mu " + (Geocode % 100).ToString(); if ( !String.IsNullOrEmpty(English) ) { lName = lName + ' ' + English; } } if ( !String.IsNullOrEmpty(this.Comment) ) { lDescription = lDescription + Environment.NewLine + this.Comment; } foreach ( EntityOffice lOffice in Offices ) { lOffice.AddToKml(lKmlWriter, lNode, lName, lDescription); } foreach ( PopulationDataEntry lEntity in SubEntities ) { lEntity.WriteToKml(lKmlWriter, lNode); } }