Home > database >  Mapbox Studio feature Z-ordering
Mapbox Studio feature Z-ordering

Time:06-24

I would like to order "circle" features in a layer in Mapbox studio. The entire Style, including this layer and other layers, is added to a map using GL.JS, and symbology for the layers are set in studio.

I see the documentation for circle-sort-key for gl-js style specification, but don't see where to set it along side the other properties (raduis, color, opacity, etc) for the layer style in studio.

CodePudding user response:

Yes, it appears you can't set it within Studio.

However, you can set it using JS if you want:

map.setLayoutProperty('mylayer', 'circle-sort-key', ...)

CodePudding user response:

Since the documentation doesn't give a detailed example, I'm adding my final solution here. Following @steve-bennett's suggestion, to sort the smallest circles on top:

map.setLayoutProperty('layername','circle-sort-key',["*", -1, ["get", "propertyname"]])
  • Related