public static void InitializeKmlDocument(this XmlDocument doc) { XmlNode documentNode = doc.GetElementsByTagName("Document")[0]; StyleKmlElement styleKmlElement = new StyleKmlElement(doc, "Red-Grid") { LineWidth = 1, LineColor = "FFFF8080", PolyColor = "800000FF" }; XmlElement styleElement = styleKmlElement.CreateElement(); FolderKmlElement folderKmlElement = new FolderKmlElement(doc, "测试点序列"); XmlElement folderElement = folderKmlElement.CreateElement(); documentNode.AppendChild(styleElement); documentNode.AppendChild(folderElement); doc.DocumentElement.AppendChild(documentNode); }
public static void InitializeKmlDocument(this XmlDocument doc, IEnumerable <string> colorStringList) { XmlNode documentNode = doc.GetElementsByTagName("Document")[0]; FolderKmlElement folderKmlElement = new FolderKmlElement(doc, "测试点序列"); XmlElement folderElement = folderKmlElement.CreateElement(); foreach (string colorString in colorStringList) { StyleKmlElement styleKmlElement = new StyleKmlElement(doc, "Color-" + colorString) { LineWidth = 1, LineColor = "FFFF8080", PolyColor = colorString }; XmlElement styleElement = styleKmlElement.CreateElement(); documentNode.AppendChild(styleElement); } documentNode.AppendChild(folderElement); doc.DocumentElement.AppendChild(documentNode); }
public static void InitializeKmlDocument(this XmlDocument doc, IEnumerable<string> colorStringList) { XmlNode documentNode = doc.GetElementsByTagName("Document")[0]; FolderKmlElement folderKmlElement = new FolderKmlElement(doc, "测试点序列"); XmlElement folderElement = folderKmlElement.CreateElement(); foreach (string colorString in colorStringList) { StyleKmlElement styleKmlElement = new StyleKmlElement(doc, "Color-" + colorString) { LineWidth = 1, LineColor = "FFFF8080", PolyColor = colorString }; XmlElement styleElement = styleKmlElement.CreateElement(); documentNode.AppendChild(styleElement); } documentNode.AppendChild(folderElement); doc.DocumentElement.AppendChild(documentNode); }