private void OnCopyPlacemarkClick(object sender, EventArgs e) { string name = "Find Center"; string lat = textBoxLatitude.Text; string lon = textBoxLongitude.Text; string ele = "0"; KmlUtils.copyPlacemarkToClipboard(null, name, lat, lon, ele); }
private void OnCopyCircleClick(object sender, EventArgs e) { string name = "Find Radius"; string lat = textBoxLatitude.Text; string lon = textBoxLongitude.Text; string ele = "0"; double radius = getRadiusInMeters(); KmlUtils.copyPlacemarkCircleToClipboard(null, name, lat, lon, ele, radius); }
protected virtual void ConvertProperties(KmlPolyStyle style, GeoJsonProperties properties) { if (style == null) { return; } if (style.Color.HasValue() && KmlUtils.TryParseHexColor(style.Color, out byte r, out byte g, out byte b, out float a)) { properties.Fill = "#" + KmlUtils.RgbToHex(r, g, b); properties.FillOpacity = (float)Math.Round(a, 2); } }
private void OnPastePlacemarkClick(object sender, EventArgs e) { double[] coords = KmlUtils.coordinatesFromClipboardPlacemark(); if (coords == null) { return; } if (Double.IsNaN(coords[0])) { textBoxLongitude.Text = ""; } else { textBoxLongitude.Text = String.Format("{0:0.000000}", coords[0]); } if (Double.IsNaN(coords[1])) { textBoxLatitude.Text = ""; } else { textBoxLatitude.Text = String.Format("{0:0.000000}", coords[1]); } }
/// <summary> /// Initializes a new KML <c><MultiGeometry></c> element. /// </summary> /// <param name="xml">The XML element the document should be based on.</param> /// <param name="namespaces">The XML namespace.</param> protected KmlMultiGeometry(XElement xml, XmlNamespaceManager namespaces) { Children = KmlUtils.ParseGeometryChildren(xml, namespaces).ToList(); }
/// <summary> /// Initializes a new KML <c><Document></c> element. /// </summary> /// <param name="xml">The XML element the document should be based on.</param> /// <param name="namespaces">The XML namespace.</param> protected KmlPlacemark(XElement xml, XmlNamespaceManager namespaces) : base(xml, namespaces) { ExtendedData = xml.GetElement("kml:ExtendedData", namespaces, KmlExtendedData.Parse); Geometry = KmlUtils.ParseGeometryChildren(xml, namespaces).FirstOrDefault(); }