Skip to content

Commit

Permalink
code review corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Nov 6, 2024
1 parent d05c1c3 commit 689c803
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const featureDataLoaderStates = {
}),
target: 'loading',
},
SET_REFRESH_MAP_LAYERS: {
actions: assign({ mapLayersToRefresh: (_, event: any) => event.refreshLayers }),
},
},
},
loading: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MAP_MAX_NATIVE_ZOOM, MAP_MAX_ZOOM } from '@/constants/strings';

import { ILayerItem } from './types';

export const PIMS_PROPERTY_BOUNDARY_KEY = 'pims_properties';
export const PIMS_PROPERTY_BOUNDARY_KEY = 'PIMS_PROPERTY_BOUNDARY_KEY';

export const layersTree: ILayerItem[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useEffect } from 'react';
import { useMap } from 'react-leaflet';

import { useMapStateMachine } from '@/components/common/mapFSM/MapStateMachineContext';
import useDeepCompareEffect from '@/hooks/util/useDeepCompareEffect';
import { exists } from '@/utils';

import { wmsHeaders } from '../Control/LayersControl/wmsHeaders';
Expand All @@ -23,7 +24,7 @@ export const LeafletLayerListener = () => {
};
}, [mapInstance]);

useEffect(() => {
useDeepCompareEffect(() => {
if (mapLayersToRefresh?.length) {
const currentLayers = featureGroup.getLayers().filter(exists);
mapLayersToRefresh.forEach(configLayer => {
Expand All @@ -39,7 +40,6 @@ export const LeafletLayerListener = () => {
}, [mapInstance, mapLayersToRefresh, setMapLayersToRefresh]);

useEffect(() => {
console.log(featureGroup.getLayers());
if (mapInstance) {
const currentLayers = featureGroup.getLayers().filter(exists);
const mapLayers = flatten(activeLayers.map(l => l.nodes));
Expand Down

0 comments on commit 689c803

Please sign in to comment.