Z-Index for MarkerAnnotation

Hey there,

is there a way to set the z-index for MarkerAnnotations in MapkitJS? I'm loading up to 200 markers dynamically as the map moves or the user zooms and I want a few specific markers to always be at the top (the best search results). The only way I found is to always remove all markers and then add them again in the right order, but that's visually so annoying to see them disappear and animate in with every tiny movement.

I thought about using a default Annotation and setting the z-index myself and trying to rebuild the balloon, including the animation when it's clicked, but the big downside is probably the performance because I won't be able to use shadow DOM elements and have 200 real DOM elements instead.

Is there a solution to this right now or is it planned to add a feature like that to Mapkit JS? It's a real blocker for me right now because all the bad content always gets rendered on top when a user zooms in, because I obviously want to show the best content first when the user isn't zoomed in yet.

Thank you so much in advance. I really appreciate it.
Manuel

Hi, the ordering of the annotations in Map.annotations array decides the display z ordering.

Z-Index for MarkerAnnotation
 
 
Q