diff --git a/maps_dashboards/public/components/layer_control_panel/layer_control_panel.tsx b/maps_dashboards/public/components/layer_control_panel/layer_control_panel.tsx index 45a43f4a..a39c1296 100644 --- a/maps_dashboards/public/components/layer_control_panel/layer_control_panel.tsx +++ b/maps_dashboards/public/components/layer_control_panel/layer_control_panel.tsx @@ -191,6 +191,11 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => { } }; + const getReverseLayers = () => { + const layersClone = [...layers]; + return layersClone.reverse(); + }; + if (isLayerControlVisible) { return ( @@ -221,7 +226,7 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => { - {layers.map((layer, index) => { + {getReverseLayers().map((layer, index) => { const isLayerSelected = isLayerConfigVisible && selectedLayerConfig &&