当前位置: 首页>>代码示例>>C#>>正文


C# Point.WritePacket方法代码示例

本文整理汇总了C#中Point.WritePacket方法的典型用法代码示例。如果您正苦于以下问题:C# Point.WritePacket方法的具体用法?C# Point.WritePacket怎么用?C# Point.WritePacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point的用法示例。


在下文中一共展示了Point.WritePacket方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PointPositionProducesCartographicRadians

        public void PointPositionProducesCartographicRadians()
        {
            XElement element = new XElement("Placemark",
                new XElement("name", "STS-122"),                
                new XElement("Point",
                    new XElement("altitudeMode", "absolute"),
                    new XElement("coordinates", "-80.604015,28.608305,48.5300000004579")));

            var point = new Point(element.Element("Point"), m_document, element);
            point.WritePacket();
            string result = m_document.StringWriter.ToString();
            Assert.That(result.Contains("\"position\":{\"cartographicRadians\":[-1.4068054520768973,0.4993091156647564,48.5300000004579]}"));
        }
开发者ID:efl0004,项目名称:czml-writer,代码行数:13,代码来源:TestPoint.cs

示例2: PointTimeSpanProducesAvailability

        public void PointTimeSpanProducesAvailability()
        {
            XElement element = new XElement("Placemark",
                new XElement("name", "STS-122"),
                new XElement("TimeSpan",
                    new XElement("begin", "2007-12-06T16:31")),
                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("Point",
                    new XElement("altitudeMode", "absolute"),
                    new XElement("coordinates", "-80.604015,28.608305,48.5300000004579")));

            var point = new Point(element.Element("Point"), m_document, element);
            point.WritePacket();
            string result = m_document.StringWriter.ToString();
            Assert.That(result.Contains("\"availability\":\"2007-12-06T16:31:00Z/-4713-11--2147483625T11:59:25Z\""));
        }
开发者ID:efl0004,项目名称:czml-writer,代码行数:16,代码来源:TestPoint.cs

示例3: PointWithIconStyleProducesBillboard

        public void PointWithIconStyleProducesBillboard()
        {
            XElement element = new XElement("Placemark",
                new XElement("name", "STS-122"),
                new XElement("TimeSpan",
                    new XElement("begin", "2007-12-06T16:31")),
                new XElement("Style", 
                    new XElement("IconStyle",
                        new XElement("color", "a1ff00ff"),
                        new XElement("scale", "2"),
                        new XElement("Icon",
                            new XElement("href", "http://maps.google.com/mapfiles/kml/pal3/icon61.png")))),
                new XElement("Point",
                    new XElement("altitudeMode", "absolute"),
                    new XElement("coordinates", "-80.604015,28.608305,48.5300000004579")));

            var point = new Point(element.Element("Point"), m_document, element);
            point.WritePacket();
            string result = m_document.StringWriter.ToString();
            Assert.That(result.Contains("\"billboard\":{"));
            Assert.That(result.Contains("\"scale\":2.0"));
            Assert.That(result.Contains("\"image\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t/AAAACW9GRnMAAACgAAAA4ACdSFTMAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAsUlEQVRYw+2WIQ6EMBREMdhVtVVLuAQSLMla7MpaFKfAcguOwNFgSMaR/JC0S1fMJM/N/51fQtuikCRJuqcSOOBBbeDpK1Mu/gIVaEAHeoOOvop1SSY/m7VgAAGMBoG+lnXRO+E40dl0AjNYDGb6Bta52ACe2xrYfAWbwUpfYJ2PDVDz246ccNsNMcRCf8/69AHen+8FBVCARwM8+RdkPweyn4TZ74Lst+FfvAckSfqpDm/T4z3U/oIsAAAAAElFTkSuQmCC\"}"));
        }
开发者ID:efl0004,项目名称:czml-writer,代码行数:23,代码来源:TestPoint.cs

示例4: ExtrudedPointWithLineStyleProducesPolylineColor

        public void ExtrudedPointWithLineStyleProducesPolylineColor()
        {
            XElement element = new XElement("Placemark",
                new XElement("name", "STS-122"),
                new XElement("Style", 
                    new XElement("LineStyle",
                        new XElement("color", "a1ff00ff"))),
                new XElement("Point",
                    new XElement("extrude", 1),
                    new XElement("altitudeMode", "absolute"),
                    new XElement("coordinates", "-80.604015,28.608305,48.5300000004579")));

            var point = new Point(element.Element("Point"), m_document, element);
            point.WritePacket();
            string result = m_document.StringWriter.ToString();
            Assert.That(result.Contains("\"polyline\":{\"color\":{\"rgba\":[255,0,255,161]}}"));
        }
开发者ID:efl0004,项目名称:czml-writer,代码行数:17,代码来源:TestPoint.cs


注:本文中的Point.WritePacket方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。