Skip to content

Commit 61630d2

Browse files
Fix dataset layers sort
1 parent a01713b commit 61630d2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

client/src/components/map/provider.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ export const useDeckMapboxOverlay = ({
144144
useEffect(() => {
145145
if (!layer) return;
146146
return () => {
147-
console.log("removeLayer", i);
148147
removeLayer(i);
149148
};
150149
}, [i, removeLayer]); // eslint-disable-line react-hooks/exhaustive-deps

client/src/containers/datasets/item.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ const DatasetsItem = ({ attributes, className }: DatasetsItemProps) => {
4646
{
4747
query: {
4848
enabled: !!datasetLayers.length,
49+
select: (data) => ({
50+
...data,
51+
data: data.data?.sort(
52+
(a, b) => datasetLayers.indexOf(a.id) - datasetLayers.indexOf(b.id),
53+
),
54+
}),
4955
},
5056
},
5157
);

client/src/containers/map/layer-manager/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const LayerManager = () => {
8484
*/}
8585
{LAYERS.map((l, i) => {
8686
const beforeId = i === 0 ? baseLayer : `${LAYERS[i - 1]}-layer`;
87-
console.log(layersSettings?.[l]);
87+
8888
return (
8989
<LayerManagerItem
9090
key={l}

0 commit comments

Comments
 (0)