Exemplo n.º 1
0
        public static KmlDocument Load(XmlDocument xmlDocument)
        {
            KmlDocument kdoc = null;
            XmlNodeList list = xmlDocument.GetElementsByTagName("Document");

            if (list.Count > 0)
            {
                XmlNode head = list[0];
                kdoc = new KmlDocument(ParseFolder(head));

                foreach (XmlNode node in head)
                {
                    string name = node.Name.ToLower();
                    switch (name)
                    {
                    case "style": kdoc.Styles.Add(ParseStyle(node)); break;

                    case "stylemap": kdoc.StyleMaps.Add(ParseStyleMap(node)); break;
                    }
                }
            }

            return(kdoc);
        }
Exemplo n.º 2
0
 public KmlDocument(KmlDocument doc) : base(doc)
 {
     Styles.AddRange(doc.Styles);
     StyleMaps.AddRange(doc.StyleMaps);
 }