I need access to extracted style attributes (e.g. fill color, stroke color, etc.) for a KML file once loaded. I can't seem to find a way to access the style once the layer has been added. The myLayer.getStyle() returns a function as expected but how does one access the style attributes?
0
votes
1 Answers
0
votes
You get the styles by calling the function.
As the docs say, you should pass an ol.Feature object and a resolution value. But it seems to return something also when you leave the parameters undefined.
var styleFn = myLayer.getStyle();
console.log(styleFn());