Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/RENCI/APSViz-UI-V3 into fea…
Browse files Browse the repository at this point in the history
…ture/dialog
  • Loading branch information
PhillipsOwen committed May 3, 2024
2 parents ba79c39 + 8e200ab commit 51d222b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/map/default-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ import { CircleMarker } from 'leaflet';
import { useLayers } from '@context';
import { markClicked } from '@utils/map-utils';

const newLayerDefaultState = layer => {
const { product_type } = layer.properties;

if (['obs', 'maxele63'].includes(product_type)) {
return ({
visible: true
});
}

return ({
visible: false
});
};


export const DefaultLayers = () => {

const [obsData, setObsData] = useState("");
Expand Down Expand Up @@ -96,9 +111,7 @@ export const DefaultLayers = () => {
if (layer)
layer_list.push({
...layer,
state: {
visible: true,
}
state: newLayerDefaultState(layer)
});

// TODO: do we really need to do this here??!
Expand Down

0 comments on commit 51d222b

Please sign in to comment.