I'm trying to add labels to polygons, and I was hoping I would be able to limit the label to the size of the polygon by setting label.width to polygon.getBounds().width. Unfortunately that doesn't seem to work. Setting the text width is certainly doing something, but it isn't setting it to the width of the polygon.
Example here: https://jsfiddle.net/yvk256L1/5/
As you can see, making the string longer doesn't change anything. Different fonts give different widths. The scale does seem t
I'm trying to add labels to polygons, and I was hoping I would be able to limit the label to the size of the polygon by setting label.width to polygon.getBounds().width. Unfortunately that doesn't seem to work. Setting the text width is certainly doing something, but it isn't setting it to the width of the polygon.
Example here: https://jsfiddle.net/yvk256L1/5/
As you can see, making the string longer doesn't change anything. Different fonts give different widths. The scale does seem t