openlayers icon indicating copy to clipboard operation
openlayers copied to clipboard

Style Array - Overlapping Marker Styles

Open thn80 opened this issue 2 years ago • 1 comments

Hi,

currently I am styling my markers using a style array, containing two style objects (the marker itself and an icon). Depending on the zoom level it happens, that my markers overlap on the map and when this happens, I get the problem as shown in the following screenshot: ol_marker_zlayer

The green marker sticks in between the white marker and the white marker's plane icon. How can I avoid that another marker gets drawn in between the styles of a single marker? I assume that manually adjusting the z-layer for each style gets complicated, because it is a problem between different markers. Any ideas?

thn80 avatar Jul 19 '22 07:07 thn80

zIndex can be set in style functions. e.g. use the x coordinate so overlapping features are stacked left to right https://codesandbox.io/s/cluster-forked-u14rwm?file=/main.js

mike-000 avatar Jul 19 '22 10:07 mike-000