Пример #1
0
 /// <summary>
 /// Converts the style object to KML.
 /// </summary>
 /// <param name="style"></param>
 /// <returns></returns>
 public static XElement ToKml(this KmlStyle style)
 {
     return(new XElement(ns + "Style", new XAttribute("id", style.GetHashCode()),
                         new XElement(ns + "IconStyle",
                                      new XElement(ns + "color", style.IconColour),
                                      new XElement(ns + "scale", style.IconScale),
                                      new XElement(ns + "Icon", style.IconUrl)),
                         new XElement(ns + "LineStyle",
                                      new XElement(ns + "color", style.LineColour),
                                      new XElement(ns + "width", style.LineWidth)),
                         new XElement(ns + "PolyStyle",
                                      new XElement(ns + "color", style.PolygonColour))));
 }
Пример #2
0
 /// <summary>
 /// Converts the feature to KML.
 /// </summary>
 /// <param name="feature"></param>
 /// <param name="name"></param>
 /// <param name="style"></param>
 /// <returns></returns>
 public static XElement ToKml(this Feature feature, string name = null, KmlStyle style = null)
 {
     return(feature.ToKml(name, 0, null, style?.ToKml()));
 }