如何在olx.style.TextOptions文本中添加新行? [英] How do I add new line in olx.style.TextOptions text?

查看:74
本文介绍了如何在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

这篇关于如何在olx.style.TextOptions文本中添加新行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆