如何在olx.style.TextOptions文本中添加新行?

问题描述:

我必须创建2行标签. 在OL 2中,我通过在文本标签中添加'\ n'来做到这一点,但是ol3似乎不支持它:

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'
            }))
        })

我该如何在1& 2个?

How can I break the line between 1 & 2 ?

库中目前不提供支持,但是人们已经讨论了ol3-dev Google小组中的解决方案以及拉取请求,例如:

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