private static PlacemarkDescriptor ExtractLinearRing(KMLStyle kmlStyle, XElement geomElement)
{
XNamespace kmlNS = geomElement.Name.Namespace;
XElement coord = geomElement.Element(kmlNS + "coordinates");
if (coord != null)
{
// Extract coordinates and build geometry
ESRI.ArcGIS.Client.Geometry.PointCollection pts = ExtractCoordinates(coord);
if (pts != null && pts.Count > 0)
{
var polyline = new Polyline();
polyline.Paths.Add(pts);
// Create symbol and use style information
LineSymbolDescriptor sym = new LineSymbolDescriptor();
sym.style = kmlStyle;
// Create feature descriptor from geometry and other information
return new PlacemarkDescriptor()
{
Geometry = polyline,
Symbol = sym
};
}
}
return null;
}