You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
const extent = geom.getExtent();
const size = Math.sqrt(Math.max(
Math.pow((extent[2] - extent[0]) / resolution, 2),
Math.pow((extent[3] - extent[1]) / resolution, 2))
);
if (size > 150) {
//FIXME Do not hard-code a size of 150
...
}
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,
The text was updated successfully, but these errors were encountered:
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 ?
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,
The text was updated successfully, but these errors were encountered: