A style of an ol.layer.Vector can be set as ol.style.Style
, a style function or an array of ol.style.Style
. What's the array for and what does it do -- compared to just passing an ol.style.Style
object?
I cannot find any information on this, neither in the official API docs nor in the tutorials.
If you look at the draw features example, when drawing lines, they are displayed in blue with a white border/outline.
These is achieved by styling the line twice, first with a large white line, then a thin blue line above.
There are 2 styles for the same geometry. It can’t be done with a single ol.style.Style
, so to achieve this you need to pass an array of 2 styles: see the source for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With