Example #1
0
 private void CreateLineStringPlacemark(IEnumerable<Waypoint> waypoints, KmlLineStyle routeLineStyle, DateTime? appearTime, DateTime? disappearTime, XmlWriter writer, IFormatProvider formatProvider)
 {
     writer.WriteStartElement("Placemark");
       writer.WriteElementString("styleUrl", "#" + GetLineStyleId(routeLineStyle));
       if (appearTime.HasValue || disappearTime.HasValue)
       {
     writer.WriteStartElement("TimeSpan");
     if (appearTime.HasValue) writer.WriteElementString("begin", FormatTime(appearTime.Value.ToUniversalTime()));
     if (disappearTime.HasValue) writer.WriteElementString("end", FormatTime(disappearTime.Value.ToUniversalTime()));
     writer.WriteEndElement(); // TimeSpan
       }
       writer.WriteStartElement("LineString");
       writer.WriteElementString("extrude", "1");
       writer.WriteElementString("tessellate", "1");
       writer.WriteStartElement("coordinates");
       foreach (var waypoint in waypoints)
       {
     writer.WriteString(waypoint.LongLat.Longitude.ToString(formatProvider) + "," +
                    waypoint.LongLat.Latitude.ToString(formatProvider) + " ");
       }
       writer.WriteEndElement();
       writer.WriteEndElement();
       writer.WriteEndElement();
 }
Example #2
0
 private void CreateLineStringPlacemark(IEnumerable<Waypoint> waypoints, KmlLineStyle routeLineStyle, XmlWriter writer, IFormatProvider formatProvider)
 {
     CreateLineStringPlacemark(waypoints, routeLineStyle, null, null, writer, formatProvider);
 }
Example #3
0
 public bool Equals(KmlLineStyle obj)
 {
     if (ReferenceEquals(null, obj)) return false;
       if (ReferenceEquals(this, obj)) return true;
       return obj.Color.Equals(Color) && obj.Width == Width;
 }
Example #4
0
 public KmlProperties()
 {
     MapType = KmlExportMapType.MapAndRoute;
       RouteType = KmlExportRouteType.None;
       ReplayType = KmlExportReplayType.None;
       ReplayTimeInterval = new TimeSpan(0, 0, 5);
       RouteLineStyle = new KmlLineStyle();
       ReplayMarkerStyle = new KmlMarkerStyle();
       ReplayTails = new List<KmlReplayTail>() { new KmlReplayTail() { StartVisible = new TimeSpan(0), EndVisible = new TimeSpan(0, 0, 60) } };
 }
Example #5
0
 private string GetLineStyleId(KmlLineStyle style)
 {
     if (!routeLineStyles.ContainsKey(style)) routeLineStyles.Add(style, "l" + routeLineStyles.Count);
       return routeLineStyles[style];
 }