Skip to content

Commit

Permalink
HMW-856 Removed Protected Areas highlight layer
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdiebold-erg committed Nov 22, 2024
1 parent 5694294 commit b7413dd
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 43 deletions.
12 changes: 1 addition & 11 deletions app/client/src/components/pages/Community.Tabs.Protect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ function Protect() {
const {
allWaterbodiesLayer,
monitoringLocationsLayer,
protectedAreasHighlightLayer,
protectedAreasLayer,
updateVisibleLayers,
usgsStreamgagesLayer,
Expand Down Expand Up @@ -395,10 +394,6 @@ function Protect() {
useEffect(() => {
if (!mapView || !selectedFeature) return;

// add it to the highlight layer
protectedAreasHighlightLayer.removeAll();
protectedAreasHighlightLayer.add(selectedFeature);

// set the highlight
// update context with the new selected graphic
selectedFeature.attributes['zoom'] = true;
Expand All @@ -407,12 +402,7 @@ function Protect() {

// reset the selectedFeature
setSelectedFeature(null);
}, [
mapView,
selectedFeature,
protectedAreasHighlightLayer,
setSelectedGraphic,
]);
}, [mapView, selectedFeature, setSelectedGraphic]);

// Initialize the visibility of several layers. This will be used
// to reset their visibility when the user leaves this tab.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const tooltipNotLoaded = {

const layersToIgnore = [
'nonprofitsLayer',
'protectedAreasHighlightLayer',
'surroundingCyanLayer',
'surroundingDischargersLayer',
'surroundingMonitoringLocationsLayer',
Expand Down
1 change: 0 additions & 1 deletion app/client/src/components/shared/MapWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ const orderedLayers = [
'wsioHealthIndexLayer',
'wildfiresLayer',
'wildScenicRiversLayer',
'protectedAreasHighlightLayer',
'protectedAreasLayer',
'disadvantagedCommunitiesLayer',
'wellsLayer',
Expand Down
3 changes: 0 additions & 3 deletions app/client/src/contexts/Layers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export function useLayers() {
mappedWaterLayer,
monitoringLocationsLayer,
nonprofitsLayer,
protectedAreasHighlightLayer,
protectedAreasLayer,
providersLayer,
searchIconLayer,
Expand Down Expand Up @@ -172,7 +171,6 @@ export function useLayers() {
coastalFloodingRealtimeLayer,
coastalFloodingLayer,
protectedAreasLayer,
protectedAreasHighlightLayer,
wildfiresLayer,
wildScenicRiversLayer,
tribalLayer,
Expand Down Expand Up @@ -331,7 +329,6 @@ const graphicsLayerIds = [
'boundariesLayer',
'issuesLayer',
'nonprofitsLayer',
'protectedAreasHighlightLayer',
'providersLayer',
'searchIconLayer',
'selectedTribeLayer',
Expand Down
27 changes: 0 additions & 27 deletions app/client/src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ function useWaterbodyHighlight(findOthers: boolean = true) {
nonprofitsLayer,
waterbodyPoints, //part of waterbody group layer
protectedAreasLayer,
protectedAreasHighlightLayer,
upstreamLayer,
usgsStreamgagesLayer,
wildScenicRiversLayer,
Expand Down Expand Up @@ -523,10 +522,6 @@ function useWaterbodyHighlight(findOthers: boolean = true) {
handles.remove(group);
mapView.graphics.removeAll();

if (protectedAreasHighlightLayer) {
protectedAreasHighlightLayer.removeAll();
}

// remove the currentHighlight and currentSelection if either exist
if (currentHighlight || currentSelection) {
currentHighlight = null;
Expand Down Expand Up @@ -593,9 +588,6 @@ function useWaterbodyHighlight(findOthers: boolean = true) {
// remove the highlights
handles.remove(group);
mapView.graphics.removeAll();
if (protectedAreasHighlightLayer) {
protectedAreasHighlightLayer.removeAll();
}

// get organizationid and assessmentunitidentifier to figure out if the
// selected waterbody changed.
Expand Down Expand Up @@ -752,7 +744,6 @@ function useWaterbodyHighlight(findOthers: boolean = true) {
handles,
wildScenicRiversLayer,
protectedAreasLayer,
protectedAreasHighlightLayer,
pointsData,
linesData,
areasData,
Expand Down Expand Up @@ -1046,21 +1037,6 @@ function useSharedLayers({
return protectedAreasLayer;
}

function getProtectedAreasHighlightLayer() {
const protectedAreasHighlightLayer = new GraphicsLayer({
id: 'protectedAreasHighlightLayer',
title: 'Protected Areas Highlight Layer',
listMode: 'hide',
});

setLayer('protectedAreasHighlightLayer', protectedAreasHighlightLayer);
setResetHandler('protectedAreasHighlightLayer', () => {
protectedAreasHighlightLayer.graphics.removeAll();
});

return protectedAreasHighlightLayer;
}

function getWildScenicRiversLayer() {
const wildScenicRiversRenderer = new SimpleRenderer({
symbol: new SimpleLineSymbol({
Expand Down Expand Up @@ -2050,8 +2026,6 @@ function useSharedLayers({

const protectedAreasLayer = getProtectedAreasLayer();

const protectedAreasHighlightLayer = getProtectedAreasHighlightLayer();

const wildScenicRiversLayer = getWildScenicRiversLayer();

const tribalLayer = getTribalLayer();
Expand Down Expand Up @@ -2113,7 +2087,6 @@ function useSharedLayers({
coastalFloodingRealtimeLayer,
coastalFloodingLayer,
protectedAreasLayer,
protectedAreasHighlightLayer,
wildScenicRiversLayer,
tribalLayer,
congressionalLayer,
Expand Down

0 comments on commit b7413dd

Please sign in to comment.