How do I add new line in olx.style.TextOptions text?

三世轮回 提交于 2019-12-24 03:27:20

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!