I would like to apply a style to the KML that gets generated from the write() operation of OpenLayers.Format.KML. The current style that is on the vector layer does not get exported with this code:
function GetKMLFromFeatures = function (features) {
var format = new OpenLayers.Format.KML({
'maxDepth':10,
'extractStyles':true,
'internalProjection': map.baseLayer.projection,
'externalProjection': new OpenLayers.Projection("EPSG:4326")
});
return format.write(features);
}
I would like to add something like this to the KML:
<Style id="PolyStyle">
<PolyStyle>
<color>ff0000cc</color>
<fill>0</fill>
<!-- boolean -->
<outline>1</outline>
<!-- boolean -->
</PolyStyle>
</Style>
So that i can specify the fill property. How annoying is this:

I want this:
