Pri Santos
Pri Santos

Reputation: 409

Multiple lines label OpenLayers3

I'm trying to create multiple lines for my icon label in 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? My '\n' are not working and I couldn't find a way to do it.

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!

Upvotes: 0

Views: 1266

Answers (1)

Alvin Lindstam
Alvin Lindstam

Reputation: 3142

No, but there is a pull request about it here. It hasn't seen any action since July, but is still open.

I'd suggest checking it out and doing a custom build with it, or contribute to the PR with testing and suggestions.

Upvotes: 1

Related Questions