Skip to content

Commit

Permalink
fixed basemap selector
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Mar 19, 2024
1 parent 10837c6 commit c5e4b46
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions client/src/containers/analysis-eudr/map/basemap/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,26 @@ const EUDRBasemapControl = () => {

const handleLightBasemap = useCallback(
(checked: boolean) => {
dispatch(setBasemap(checked ? 'light' : 'planet'));
if (checked) {
dispatch(setBasemap('light'));
dispatch(setPlanetLayer({ active: !checked }));
dispatch(setPlanetLayer({ active: false }));
dispatch(setPlanetCompareLayer({ active: false }));
} else {
dispatch(setBasemap('planet'));
dispatch(setPlanetLayer({ active: checked }));
dispatch(setPlanetLayer({ active: true }));
}
},
[dispatch],
);

const handlePlanetLayer = useCallback(
(checked: boolean) => {
dispatch(setBasemap('planet'));
if (!checked) {
dispatch(setBasemap('light'));
dispatch(setPlanetCompareLayer({ active: false }));
} else {
dispatch(setBasemap('planet'));
}
dispatch(setPlanetLayer({ active: checked }));
if (!checked) dispatch(setPlanetCompareLayer({ active: false }));
},
[dispatch],
);
Expand Down

0 comments on commit c5e4b46

Please sign in to comment.