Skip to content

Commit

Permalink
update wms visibility method
Browse files Browse the repository at this point in the history
  • Loading branch information
meghna0593 committed Jan 2, 2025
1 parent 53b0b61 commit 183f1db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/UI/LegacyMap/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
removeDeletedRecordSetLayersOnRecordSetDelete,
removeLayersOnNetworkConnectivityChange
} from 'UI/LegacyMap/helpers/recordset-layers';
import { addWMSLayersIfNotExist, refreshWMSOnToggle, hideWMSIfUnauthenticated } from 'UI/LegacyMap/helpers/wms-layers';
import { addWMSLayersIfNotExist, refreshWMSOnToggle, hideWMSIfUnauthorized } from 'UI/LegacyMap/helpers/wms-layers';
import {
addServerBoundariesIfNotExists,
refreshServerBoundariesOnToggle
Expand Down Expand Up @@ -217,7 +217,7 @@ export const Map = ({ children }) => {

const layers = connectedToNetwork ? simplePickerLayers2 : DEFAULT_LOCAL_LAYERS;
if (!authenticated || !rolesInitialized) {
hideWMSIfUnauthenticated(layers, map.current);
hideWMSIfUnauthorized(layers, map.current);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/UI/LegacyMap/helpers/wms-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const refreshWMSOnToggle = (simplePickerLayers2, map) => {
});
};

export const hideWMSIfUnauthenticated = (simplePickerLayers2, map) => {
export const hideWMSIfUnauthorized = (simplePickerLayers2, map) => {
simplePickerLayers2.map((layer) => {
if (map.getLayer(layer.url)) {
map.setLayoutProperty(layer.url, 'visibility', 'none');
Expand Down

0 comments on commit 183f1db

Please sign in to comment.