コード例 #1
0
        public void GxTrackProducesInstantaneousAvailability()
        {
            XElement element = new XElement("Placemark", new XAttribute(XNamespace.Xmlns + "gx", "http://www.google.com/kml/ext/2.2"),
                                            new XElement("name", "STS-122"),
                                            new XElement("description",
                                                         new XCData("<html><table><tr><td><b>Start Time (T-0:44): </b></td><td>2007 Dec 6 16:31:00.000 EST</td></tr></table></html>")),
                                            new XElement(m_gxNamespace + "Track",
                                                         new XElement("when", "2007-12-06T16:31"),
                                                         new XElement(m_gxNamespace + "coord", "0 0 0")));

            var point = new GxTrack(element.Element(m_gxNamespace + "Track"), m_document, element);
            point.WritePacket();

            string result = m_stringWriter.ToString();
            StringAssert.Contains("\"availability\":\"20071206T1631Z/20071206T1631Z\"", result);
        }
コード例 #2
0
        public void GxTrackProducesSinglePosition()
        {
            XElement element = new XElement("Placemark", new XAttribute(XNamespace.Xmlns + "gx", "http://www.google.com/kml/ext/2.2"),
                                            new XElement("name", "STS-122"),
                                            new XElement("description",
                                                         new XCData("<html><table><tr><td><b>Start Time (T-0:44): </b></td><td>2007 Dec 6 16:31:00.000 EST</td></tr></table></html>")),
                                            new XElement(m_gxNamespace + "Track",
                                                         new XElement("when", "2007-12-06T16:31"),
                                                         new XElement(m_gxNamespace + "coord", "0 1 0")));

            var point = new GxTrack(element.Element(m_gxNamespace + "Track"), m_document, element);
            point.WritePacket();

            string result = m_stringWriter.ToString();
            StringAssert.Contains("\"cartographicRadians\":[0,0,0.017453292519943295,0]", result);
        }
コード例 #3
0
        public void GxTrackAbsoluteAltitudeModePreservesHeight()
        {
            XElement element = new XElement("Placemark", new XAttribute(XNamespace.Xmlns + "gx", "http://www.google.com/kml/ext/2.2"),
                                            new XElement("name", "STS-122"),
                                            new XElement("description",
                                                         new XCData("<html><table><tr><td><b>Start Time (T-0:44): </b></td><td>2007 Dec 6 16:31:00.000 EST</td></tr></table></html>")),
                                            new XElement(m_gxNamespace + "Track",
                                                         new XElement("when", "2007-12-06T16:31"),
                                                         new XElement(m_gxNamespace + "coord", "0 1 5"),
                                                         new XElement("when", "2007-12-06T17:31"),
                                                         new XElement(m_gxNamespace + "coord", "0 2 6"),
                                                         new XElement("when", "2007-12-06T18:31"),
                                                         new XElement(m_gxNamespace + "coord", "0 3 7"),
                                                         new XElement("altitudeMode", "absolute")));

            var point = new GxTrack(element.Element(m_gxNamespace + "Track"), m_document, element);
            point.WritePacket();

            string result = m_stringWriter.ToString();
            StringAssert.Contains("\"cartographicRadians\":[0,0,0.017453292519943295,5,3600,0,0.03490658503988659,6,7200,0,0.05235987755982989,7]", result);
        }