mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

[android] Single marker z-order: keep a marker on top of everything else, moving it continuously #10193

Closed nicomazz closed 7 years ago

nicomazz commented 7 years ago

Platform: Android Mapbox SDK version: 5.1.3 There is currently no way to adjust the z-index of each marker individually. There are already many questions about this on stackoverflow (without real solutions). The problem with using marker levels is that the continuous shift of one of these triggers performance issues. I think it would be very handy and useful to many.

Desired behavior: With a map full of POIs, a custom marker for the position of the user in continuous motion. This last marker should always be above all others.

tobrun commented 7 years ago

The desired behavior can be achieved with having a separate SymbolLayer. FWIW we have LocationLayer plugin that does exactly this in https://github.com/mapbox/mapbox-plugins-android/tree/master/plugins/locationlayer.

farfromrefug commented 6 years ago

@tobrun wouldn't be good to have it as symbol property? It could be very useful for GeoJSON or Marker to make some appear on top of each others. Plus if we have multiple markers with zIndex we would not need to create one Symbol Layer per marker. I am more than willing to help if you think this is a good idea. I am currently diving into mgl code, which is quite big ;)

Xgamefactory commented 6 years ago

we are totally agree. juwst take mapbox ios sdk or heremaps or other prof instread of making hard such simple things.

tobrun commented 6 years ago

With the upcoming 6.6.0 release symbol layer will support z ordering based on data ordering:

That said, I'm working on an annotation plugin that will integrate above but in an easier to use api. You will be able to provide an int value and we will show markers above another based on that value. Annotation plugin is in the works here, code for z symbol ordering is implemented but requires the release of 6.6.0 first. See feature request here.