diff --git a/client/src/containers/map/layer-manager/index.tsx b/client/src/containers/map/layer-manager/index.tsx index 761e3e0..757d07e 100644 --- a/client/src/containers/map/layer-manager/index.tsx +++ b/client/src/containers/map/layer-manager/index.tsx @@ -60,18 +60,22 @@ const LayerManager = () => { Generate all transparent backgrounds to be able to sort by layers without an error - https://github.com/visgl/react-map-gl/issues/939#issuecomment-625290200 */} - {layers.map((l, i) => { - const beforeId = i === 0 ? baseLayer : `${layers[i - 1]}-layer`; - return ( - - ); - })} + {layers + .toSorted((a) => { + return a.includes("rangeland") ? 1 : -1; + }) + .map((l, i) => { + const beforeId = i === 0 ? baseLayer : `${layers[i - 1]}-layer`; + return ( + + ); + })} {/* Loop through active layers. The id is gonna be used to fetch the current layer and know how to order the layers.