Exemple #1
0
 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);
     }
 }
Exemple #2
0
        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());
            }
        }