Open mshubin opened 3 years ago
To properly replace the hard-coded value with a style config option, you would have to use symbol-spacing
. Then, instead of using the midpoint of the geometry, you would have to use getLength()
, getCoordinateAtM()
and the current resolution to determine one or more points along the line where the symbol would be placed.
I see for symbol-spacing
argument but correct me if I'm wrong, in this part of code we have only access to RenderFeature
and not the LineString
geometry. So to use getLength()
& getCoordinateAtM()
I can use lineStringLength
& lineStringCoordinateAtM
methods from ol.geom.flat
?
Yes exactly, you have to use the respective functions from ol/geom/flat
.
Hi,
I have a rotated symbols which are placed along the line by using 'symbol-placement' and 'icon-rotation-alignment'. But I've noticed that these symbols appear only when zooming really close to my lines, which is problematic. By reading the code there is a "magic number" test with a FIXME comment:
Do you know how you would like to fix it ? I don't think that we really need this check, because we can still hide these symbols by using 'minzoom' attribute ? What do you think ?
Thank you in advance,