Esempio n. 1
0
        internal KMLPoint(XmlElement element, KMLFeature owner, KMLFile source)
            : base(element, owner, source)
        {
            bool blCoordinatesSet = false;

            foreach (XmlNode oChild in element.ChildNodes)
            {
                if (oChild.NodeType != XmlNodeType.Element) continue;
                XmlElement oChildElement = oChild as XmlElement;

                if (oChildElement.Name.Equals("extrude"))
                {
                    m_blExtrude = oChildElement.InnerText.Equals("1");
                }
                else if (oChildElement.Name.Equals("altitudeMode"))
                {
                    m_eAltitudeMode = (KMLAltitudeMode)Enum.Parse(typeof(KMLAltitudeMode), oChildElement.InnerText);
                }
                else if (oChildElement.Name.Equals("coordinates"))
                {
                    m_oCoords = new KMLCoordinates(oChildElement.InnerText.Trim());
                    blCoordinatesSet = true;
                }
            }

            if (!blCoordinatesSet) throw new ArgumentException("The KML file contains a 'Point' element without a 'Coordinates' element.");
        }
Esempio n. 2
0
 internal KMLGeometry(XmlElement element, KMLFeature owner, KMLFile source)
     : base(element, source)
 {
     m_oOwner = owner;
 }