Mapbox Studio feature Z-ordering

439 Views Asked by At

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.

2

There are 2 best solutions below

0
JMers On BEST ANSWER

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"]])
2
Steve Bennett On

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', ...)