/// <summary>
        /// Writes the value expressed as a <c>heightReference</c>, which is the height reference.
        /// </summary>
        /// <param name="value">The height reference.</param>
        public void WriteHeightReference(CesiumHeightReference value)
        {
            const string PropertyName = HeightReferencePropertyName;

            if (ForceInterval)
            {
                OpenIntervalIfNecessary();
            }
            if (IsInterval)
            {
                Output.WritePropertyName(PropertyName);
            }
            Output.WriteValue(CesiumFormattingHelper.HeightReferenceToString(value));
        }
Exemple #2
0
        public void TestHeightReferenceProperties()
        {
            const double expectedExtrudedHeight = 10.0;
            const CesiumHeightReference expectedExtrudedHeightReference = CesiumHeightReference.RelativeToGround;

            using (Packet)
                using (var rectangle = Packet.OpenRectangleProperty())
                    using (var interval = rectangle.OpenInterval())
                    {
                        interval.WriteExtrudedHeightProperty(expectedExtrudedHeight);
                        interval.WriteExtrudedHeightReferenceProperty(expectedExtrudedHeightReference);
                    }

            AssertExpectedJson(PacketCesiumWriter.RectanglePropertyName, new Dictionary <string, object>
            {
                { RectangleCesiumWriter.ExtrudedHeightPropertyName, expectedExtrudedHeight },
                { RectangleCesiumWriter.ExtrudedHeightReferencePropertyName, CesiumFormattingHelper.HeightReferenceToString(expectedExtrudedHeightReference) },
            });
        }
        public void TestHeightReferenceToString(CesiumHeightReference value)
        {
            string s = CesiumFormattingHelper.HeightReferenceToString(value);

            Assert.IsNotNull(s);
        }