How can I get this with OpenLayers?

How can I get this with OpenLayers?

I try to label polygons from a WFS-Source with an attribute. This works fine, but my problem is that the size of this label is scale depending. It has the same size on every scale. But i want it to become smaller/bigger if i zoom out/in the map. Like the polygons become smaller zooming out the map. How can i get this with Openlayers?

Which is the latest version of OpenLayers for scale?

This example uses OpenLayers v 6.6.1. The latest is v 6.6.0 . Example of a scale line.

How to add vector labels in OpenLayers 3?

I have no idea how to do this and all my googling has come up with this article: http://openlayers.org/en/v3.3.0/examples/vector-labels.html which I find totally confusing as I’m a little new to OL!

How to add a text label to ol.feature?

To add a text to ol.Feature you will store the description in the feature and set a style that is a style function (that will get the description from the feature and show it):

How to add a label to a polygon?

I have the current set up here: fully functional fiddle example and whilst I have managed to zoom to each polygon feature I would also like to display a centralised text label on each… the field_title variable found within the get_fields method.

How to create multi line labels in OpenLayers?

When “Text/Wrap” is chosen (for example for the line features), the label is wrapped by inserting the character , which will create a multi-line label. The “Open Sans” web font will be loaded on demand, to show dynamic font loading.

Which is the latest version of OpenLayers for vector labels?

This example uses OpenLayers v 6.6.0. The latest is v 6.5.0 . MaxReso.: MaxReso.: MaxReso.: Example of GeoJSON features with labels. This example showcases a number of options that can be set on text styles.

How do you find the correct font size?

You can use that to calculate the correct font size you need. You’ll have to figure out the best values yourself, depending on your scale and use case. But that is a simple matter of finding the right multiplier to scale the textsize.