Leaflet overlay order (points, lines, and polygons)
<p>I'm working with the <a href="https://github.com/davicustodio/Leaflet.StyledLayerControl" rel="nofollow">Leaflet.StyledLayerControl</a> plugin and would like to set my layers so that polygons always get pushed to the back, lines above the polygons, and points above the lines. </p>

<p>I have searched for solutions here but most refer to tilelayers or map panes (which I think only work with another version of leaflet 1.0). </p>

<p>I want to be able to toggle lines on and off and have them always be below points (same with polygons below polylines). </p>

<p>I'm guessing I have to do something with <code>setZIndex</code> or <code>bringToFront()</code> but i'm not sure where to start. </p>

<p>Any help would be appreciated. Thanks. </p>