ghettovoice / vuelayers

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

Attribute-based styling of features #392

Closed sh-aix closed 3 years ago

sh-aix commented 3 years ago

Hey there,

is it possible to do an attribute-based styling, e.g. based on a property of the feature?

I am using a vl-style-text and like to adjust the text according to the feature:

"vl-style-text": { "text": "3A", "font": "15px FontAwesome", "fill": { "color": "#2355af" }, "stroke": { "color": "white" } }

Thanks, Stefan

ghettovoice commented 3 years ago

Hello @sh-aix , you should use vl-style-func component for dynamic styling. There is an example https://jsfiddle.net/ghettovoice/wxf43djb/

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.