ol-ext: style textPath
with placement:line instead.
is a function to draw text along a linear feature (ol.geom.lineString) on postcompose.
The function is called as the ol.vector.setStyle() function but rendered in a postcompose frame.
is defined but ol.style.Text
can be used instead.
You can specify a minResolution
to prevent drawing beneath this resolution.
The rotateWithView option is used to render readable text (the function tries to display text upward).
The textOverflow option determines how overflowed content that is not displayed is signaled to users.
If the length of the linestring (in pixel) is less than minWidth, text won't be displayed.
The example uses an ol.geom.LineString.cspline
to smooth support and avoid letters collision.