style-box gone in v0.12
ole1986 opened this issue · 2 comments
ole1986 commented
I am using the at some places, but with version 0.12 the style-box has been removed.
What is the alternative to:
<vl-layer-vector [...]>
<vl-style-box>
<vl-style-fill color="#0000"></vl-style-fill>
<vl-style-stroke color="#2228" :width="2"></vl-style-stroke>
</vl-style-box>
</vl-layer-vector>
ole1986 commented
To answer my own question.
Using a style-func solves the issue
<vl-style-func :factory="myStyleFactory" />
myStyleFactory () {
return (feature, resolution) => {
return new Style({
fill: new Fill({ color: '#0000' }),
stroke: new Stroke({ color: '#2228', width: 2 })
})
}
}
ghettovoice commented
Hello @ole1986 ,
vl-style-box
is renamed to vl-style
in v0.12.
But you are right, vl-style-func
can be used instead.