Skip to content

Commit

Permalink
Reverse layer list (#127)
Browse files Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]>
  • Loading branch information
junqiu-lei authored Dec 20, 2022
1 parent 8fac2d9 commit a0553cf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => {
}
};

const getReverseLayers = () => {
const layersClone = [...layers];
return layersClone.reverse();
};

if (isLayerControlVisible) {
return (
<I18nProvider>
Expand Down Expand Up @@ -221,7 +226,7 @@ const LayerControlPanel = memo(({ maplibreRef, setLayers, layers }: Props) => {
<EuiHorizontalRule margin="none" />
<EuiDragDropContext onDragEnd={onDragEnd}>
<EuiDroppable droppableId="LAYERS_HANDLE_DROPPABLE_AREA" spacing="none">
{layers.map((layer, index) => {
{getReverseLayers().map((layer, index) => {
const isLayerSelected =
isLayerConfigVisible &&
selectedLayerConfig &&
Expand Down

0 comments on commit a0553cf

Please sign in to comment.