Oraxia,
This code works for both lines and polygons. If the 'polygonPlacemark'
was a 'lineStringPlacemark' the same code will work.
I run this code (snippet) for linestrings and polylines the 'ikp'
variable can either be a polygon or linestring placemark.
ikp.setStyleSelector(_ge.GetPlugin().createStyle(""));
var style = ikp.getStyleSelector() as IKmlStyle;
IKmlLineStyle lineStyle = style.getLineStyle();
if (attributes.BorderStyle == LineStyle.Thick ||
attributes.BorderStyle == LineStyle.Chain ||
attributes.BorderStyle == LineStyle.ZigZag )
{
lineStyle.setWidth(5);
}
else
{
lineStyle.setWidth(2);
}
lineStyle.getColor().setA(attributes.BorderColor.A);
lineStyle.getColor().setR(attributes.BorderColor.R);
lineStyle.getColor().setG(attributes.BorderColor.G);
lineStyle.getColor().setB(attributes.BorderColor.B);
style.getPolyStyle().setFill(1);
style.getPolyStyle().setOutline(1);
style.getPolyStyle().getColor().setA
(attributes.FillColor.A);
style.getPolyStyle().getColor().setR
(attributes.FillColor.R);
style.getPolyStyle().getColor().setG
(attributes.FillColor.G);
style.getPolyStyle().getColor().setB
(attributes.FillColor.B);