Skip to content

Commit

Permalink
hi res updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Jul 24, 2024
1 parent e5db688 commit b6e0e55
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/components/contextual/hi-res-extent-basemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ import type { ContextualBasemapsId } from 'types/widget';

const HighResolutionExtentBasemap = () => {
const [activeLayers, setActiveLayers] = useRecoilState(activeLayersAtom);
const defaultActive = activeLayers.find((layer) => layer.id.includes('planet'))?.id || 'no-layer';
const defaultActive =
activeLayers.find((layer) => layer.id === 'hi-res-extent')?.id || 'no-layer';
const [isActive, setIsActive] = useState(defaultActive);

const handleClick = useCallback(
(id) => {
setIsActive(id);
const noPlanetLayers = activeLayers.filter((w) => !w.id.includes('planet_medres'));
const layersUpdate =
id === 'no-layer'
? noPlanetLayers
? activeLayers.filter((w) => w.id !== 'hi-res-extent')
: ([
...activeLayers,
{
id: id as ContextualBasemapsId,
id: 'hi-res-extent' as ContextualBasemapsId,
opacity: '1',
visibility: 'visible',
},
...noPlanetLayers,
] as ActiveLayers[]);
setActiveLayers(layersUpdate);
},
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/contextual-layers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const CONTEXTUAL_LAYERS_PLANET_SERIES_ATTRIBUTES = [

export const HIGH_RESOLUTION_EXTENT = [
{
id: 'high_res_extent',
id: 'hi-res-extent',
type: 'contextual-basemap',
name: 'High resolution extent layer',
description: 'LOREM IPSUM',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function useSource(): SourceProps {
return {
id: 'hi-res-extent',
type: 'vector',
url: 'mapbox://globalmangrovewatch.gmw_v4_sen2_sgl_cls_v007_z2_z12',
url: 'mapbox://globalmangrovewatch.gmw_v4_sen2_sgl_cls_v007_all_z',
};
}
const darkTeal = '#005f73';
Expand Down
3 changes: 1 addition & 2 deletions src/containers/map/layer-manager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ const LayerManagerContainer = () => {

// layers that act as basemap (such planet imagery or high resolution extent) must be always at the bottom
const basemap_layers = ACTIVE_LAYERS.filter(
(layer) =>
(layer.includes('planet') || layer === 'hi-res-extent') && filteredLayers.includes(layer)
(layer) => layer.includes('planet') || layer === 'hi-res-extent'
);
const no_planet_layers = ACTIVE_LAYERS.filter(
(layer) =>
Expand Down

0 comments on commit b6e0e55

Please sign in to comment.