Exemplo n.º 1
0
        public void AppendToNode(OnlineMapsXML node)
        {
            node.A("lat", lat);
            node.A("lon", lon);

            if (elevation.HasValue) node.Create("ele", elevation.Value);
            if (time.HasValue) node.Create("time", time.Value.ToUniversalTime().ToString("s") + "Z");
            if (magvar.HasValue) node.Create("magvar", magvar.Value);
            if (geoidheight.HasValue) node.Create("geoidheight", geoidheight.Value);
            if (!string.IsNullOrEmpty(name)) node.Create("name", name);
            if (!string.IsNullOrEmpty(comment)) node.Create("cmt", comment);
            if (!string.IsNullOrEmpty(description)) node.Create("desc", description);
            if (!string.IsNullOrEmpty(source)) node.Create("src", source);
            if (links != null) foreach (Link l in links) l.AppendToNode(node.Create("link"));
            if (!string.IsNullOrEmpty(symbol)) node.Create("sym", symbol);
            if (!string.IsNullOrEmpty(type)) node.Create("type", type);
            if (!string.IsNullOrEmpty(fix)) node.Create("fix", fix);
            if (sat.HasValue) node.Create("sat", sat.Value);
            if (hdop.HasValue) node.Create("hdop", hdop.Value);
            if (vdop.HasValue) node.Create("vdop", vdop.Value);
            if (pdop.HasValue) node.Create("pdop", pdop.Value);
            if (ageofdgpsdata.HasValue) node.Create("ageofdgpsdata", ageofdgpsdata.Value);
            if (dgpsid.HasValue) node.Create("dgpsid", dgpsid.Value);
            if (extensions != null) node.AppendChild(extensions);
        }
 public void AppendToNode(OnlineMapsXML node)
 {
     foreach (Waypoint p in points)
     {
         p.AppendToNode(node.Create("trkpt"));
     }
     if (extensions != null)
     {
         node.AppendChild(extensions);
     }
 }
Exemplo n.º 3
0
 public void AppendToNode(OnlineMapsXML node)
 {
     if (!string.IsNullOrEmpty(name)) node.Create("name", name);
     if (!string.IsNullOrEmpty(comment)) node.Create("cmt", comment);
     if (!string.IsNullOrEmpty(description)) node.Create("desc", description);
     if (!string.IsNullOrEmpty(source)) node.Create("src", source);
     if (links != null) foreach (Link l in links) l.AppendToNode(node.Create("link"));
     if (number.HasValue) node.Create("number", number.Value);
     if (!string.IsNullOrEmpty(type)) node.Create("type", type);
     foreach (TrackSegment p in segments) p.AppendToNode(node.Create("trkseg"));
     if (extensions != null) node.AppendChild(extensions);
 }
Exemplo n.º 4
0
 public void AppendToNode(OnlineMapsXML node)
 {
     if (!string.IsNullOrEmpty(name)) node.Create("name", name);
     if (!string.IsNullOrEmpty(description)) node.Create("desc", description);
     if (author != null) author.AppendToNode(node);
     if (copyright != null) copyright.AppendToNode(node.Create("copyright"));
     if (links != null && links.Count > 0) foreach (Link l in links) l.AppendToNode(node.Create("link"));
     if (time.HasValue) node.Create("time", time.Value.ToUniversalTime().ToString("s") + "Z");
     if (!string.IsNullOrEmpty(keywords)) node.Create("keywords", keywords);
     if (bounds != null) bounds.AppendToNode(node.Create("bounds"));
     if (extensions != null) node.AppendChild(extensions);
 }
Exemplo n.º 5
0
    /// <summary>
    /// Returns OnlineMapsXML, contains full information about GPX Object.
    /// </summary>
    /// <returns>Instance of OnlineMapsXML.</returns>
    public OnlineMapsXML ToXML()
    {
        OnlineMapsXML xml = new OnlineMapsXML("gpx");
        xml.A("version", version);
        xml.A("creator", creator);

        if (metadata != null) metadata.AppendToNode(xml.Create("metadata"));
        if (waypoints != null) foreach (Waypoint i in waypoints) i.AppendToNode(xml.Create("wpt"));
        if (routes != null) foreach (Route i in routes) i.AppendToNode(xml.Create("rte"));
        if (tracks != null) foreach (Track i in tracks) i.AppendToNode(xml.Create("trk"));
        if (extensions != null) xml.AppendChild(extensions);

        return xml;
    }
 public void AppendToNode(OnlineMapsXML node)
 {
     if (!string.IsNullOrEmpty(name))
     {
         node.Create("name", name);
     }
     if (!string.IsNullOrEmpty(comment))
     {
         node.Create("cmt", comment);
     }
     if (!string.IsNullOrEmpty(description))
     {
         node.Create("desc", description);
     }
     if (!string.IsNullOrEmpty(source))
     {
         node.Create("src", source);
     }
     if (links != null)
     {
         foreach (Link l in links)
         {
             l.AppendToNode(node.Create("link"));
         }
     }
     if (number.HasValue)
     {
         node.Create("number", number.Value);
     }
     if (!string.IsNullOrEmpty(type))
     {
         node.Create("type", type);
     }
     foreach (Waypoint p in points)
     {
         p.AppendToNode(node.Create("rtept"));
     }
     if (extensions != null)
     {
         node.AppendChild(extensions);
     }
 }