コード例 #1
0
ファイル: GoogleKml.cs プロジェクト: ouyh18/LteTools
        public static XmlDocument GenerateKmlDoc(List<MeasurePointInfo> measurePointList, 
            StatValueField field, TextReader reader)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(reader);
            doc.InitializeKmlDocument(field.IntervalList.Select(x => x.Color.ColorStringForKml));

            for (int i = 0; i < measurePointList.Count(); i++)
            {
                PlacemarkKmlElement placemarkKmlElement = new PlacemarkKmlElement(doc, "测试点")
                {
                    StyleUrl = "Color-" + measurePointList[i].ColorStringForKml,
                    CoordinatesInfo = measurePointList[i].CoordinatesInfo
                };
                XmlElement placemarkElement = placemarkKmlElement.CreateElement();
                doc.AddPlacemarkElement(placemarkElement);
            }
            return doc;
        }
コード例 #2
0
        public static XmlDocument GenerateKmlDoc(List <MeasurePointInfo> measurePointList,
                                                 StatValueField field, TextReader reader)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(reader);
            doc.InitializeKmlDocument(field.IntervalList.Select(x => x.Color.ColorStringForKml));

            for (int i = 0; i < measurePointList.Count(); i++)
            {
                PlacemarkKmlElement placemarkKmlElement = new PlacemarkKmlElement(doc, "测试点")
                {
                    StyleUrl        = "Color-" + measurePointList[i].ColorStringForKml,
                    CoordinatesInfo = measurePointList[i].CoordinatesInfo
                };
                XmlElement placemarkElement = placemarkKmlElement.CreateElement();
                doc.AddPlacemarkElement(placemarkElement);
            }
            return(doc);
        }