ghettovoice / vuelayers

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

textFontSize, textFontWeight not being applied in v12 #365

Closed aliciahogue closed 3 years ago

aliciahogue commented 3 years ago

The properties are listed, but the style.js is missing the portion that handles it otherwise.

-- from v11 which is missing in v12

let fontSize = '10px' if (vlStyle.textFontSize) { fontSize = isNumber(vlStyle.textFontSize) ? vlStyle.textFontSize + 'px' : vlStyle.textFontSize } let fontName = vlStyle.textFont || 'sans-serif' const font = [vlStyle.textFontWeight, fontSize, fontName].filter(x => !!x).join(' ')

ghettovoice commented 3 years ago

Hi @aliciahogue , yes, in v0.12 all this separate options was merged into single textFont like in OpenLayers font option for ol/style/Text. https://openlayers.org/en/latest/apidoc/module-ol_style_Text-Text.html

So just you need font description string yourself as you need like in CSS. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font https://developer.mozilla.org/en-US/docs/Web/CSS/font

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.