Z Index for Markers

I want to implement a special kind of markers that are always drawn above all other markers. So I was looking how to set z index for a marker, but I did not find a proper method to do this in class MarkerBuilder.
So how can I do this?

Hi,

Unfortunately markers do not provide ability to move them in the Z index. However your use case seems kinda similar to the custom map banner example.

Additionally I think it would be also achievable by adding a new layer & source to the style which can be moved over other layers:

Let me know if that helps.

2 Likes

i had a problem with chevron but its the same thing. This is the topic Chevron Z Index

No, sorry, none of these helps.

It seems that only one “custom map banner” is possible, but I have more than one marker that has to be above the other markers.

It also seems that Layers do not work because:

  • GeoJSON does not support bitmaps nor Text, so this does not work for markers
  • Images are supportet but are drawn in a fixed LatLng rectangle, so this also does not work for markers.

I don’t know what you are trying to achieve but u can use bitmaps and text with geoJson and u can also update the Lat lng of image every second if u want, u cant also specify which marker to be on top and many other options listed here Map Style Specification | Map Display API Documentation, Map Styles | Map Display API | TomTom Developer Portal

1 Like