问题
I have to create label with 2 rows. in OL 2 I've did it by adding '\n' in the text label but it seems that ol3 doesn't support it:
new ol.style.Style({
text : new ol.style.Text(/** @type {olx.style.TextOptions} */ ({
text:'line 1 \n line 2'
}))
})
How can I break the line between 1 & 2 ?
回答1:
There is no support in the library currently but people have discussed solutions in the ol3-dev Google group as well as pull requests such as: https://github.com/openlayers/ol3/pull/3538
来源:https://stackoverflow.com/questions/30383176/how-do-i-add-new-line-in-olx-style-textoptions-text