简体   繁体   English

多行标签为OpenLayers3

[英]Multiple lines label OpenLayers3

I'm trying to create multiple lines for my icon label in OL3. 我正在尝试为OL3中的图标标签创建多行。 I need to create a four line label. 我需要创建一个四行标签。 I saw a question here , but there is no answer solving the problem. 我在这里看到了一个问题,但是没有答案可以解决问题。 Does OL3 cover a solution for that now? OL3现在是否涵盖该解决方案? My '\\n' are not working and I couldn't find a way to do it. 我的'\\ n'无法正常工作,我找不到解决方法。

point= new ol.style.Style({
               image: new ol.style.Icon({
                    src: 'img/point.ico'

                }),
                text: new ol.style.Text({
                    font: '12px Calibri,sans-serif',
                    fill: new ol.style.Fill({ color: color }),
                    stroke: new ol.style.Stroke({
                        color: '#fff', width: 2
                    }),
                    text: "Text /n More Text /n Even More /n Last Line"
                })
            });

Thanks, any help or links are much appreciated! 谢谢,任何帮助或链接都非常感谢!

No, but there is a pull request about it here . 没有,但有一个关于它的拉力要求在这里 It hasn't seen any action since July, but is still open. 自从7月以来,它还没有采取任何行动,但是仍然开放。

I'd suggest checking it out and doing a custom build with it, or contribute to the PR with testing and suggestions. 我建议您检查一下并使用它进行自定义构建,或者通过测试和建议为PR做出贡献。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM