ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
682 stars 230 forks source link

style-box gone in v0.12 #529

Closed ole1986 closed 1 year ago

ole1986 commented 1 year ago

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 1 year ago

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 1 year ago

Hello @ole1986 , vl-style-box is renamed to vl-style in v0.12. But you are right, vl-style-func can be used instead.