예제 #1
0
 public KmlFolder CloneWithExcluding(IKmlElement[] elementsToExclude)
 {
     return(new KmlFolder(Name,
                          Placemarks
                          .Where(p => !elementsToExclude.Contains(p))
                          .Select(p => p.Clone())));
 }
예제 #2
0
        public override string ToString()
        {
            string retVal = string.Empty;

            if (Placemarks != null && Placemarks.Any(x => !string.IsNullOrEmpty(x.ToString())))
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("<kml xmlns=\'http://www.opengis.net/kml/2.2'>");
                sb.AppendLine("<Document>");
                foreach (KMLPlacemark placeMark in Placemarks.Where(x => x.HasData))
                {
                    sb.AppendLine(placeMark.ToString());
                }
                sb.AppendLine("</Document>");
                sb.AppendLine("</kml>");
                retVal = sb.ToString();
            }
            return(retVal);
        }