From bac8c85a6c17ffb7f0af4b8daa2af0d1505a59d5 Mon Sep 17 00:00:00 2001 From: Vim USDS Date: Thu, 11 Aug 2022 06:51:11 -0700 Subject: [PATCH] Update AK layer id - make AK layer clickable --- client/src/components/J40Map.tsx | 21 +++++++++++++------ .../MapTribalLayer/MapTribalLayer.tsx | 3 ++- client/src/data/constants.tsx | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/client/src/components/J40Map.tsx b/client/src/components/J40Map.tsx index d2be5e86..dcbce590 100644 --- a/client/src/components/J40Map.tsx +++ b/client/src/components/J40Map.tsx @@ -84,7 +84,7 @@ const J40Map = ({location}: IJ40Interface) => { const [transitionInProgress, setTransitionInProgress] = useState(false); const [geolocationInProgress, setGeolocationInProgress] = useState(false); const [isMobileMapState, setIsMobileMapState] = useState(false); - const [censusSelected, setCensusSelected] = useState(true); + const [censusSelected, setCensusSelected] = useState(true); // In order to detect that the layer has been toggled (between census and tribal), // this state variable will hold that information @@ -350,7 +350,15 @@ const J40Map = ({location}: IJ40Interface) => { dragRotate={false} touchRotate={false} // eslint-disable-next-line max-len - interactiveLayerIds={censusSelected ? [constants.HIGH_ZOOM_LAYER_ID, constants.PRIORITIZED_HIGH_ZOOM_LAYER_ID] : [constants.TRIBAL_LAYER_ID]} + interactiveLayerIds={censusSelected ? + [ + constants.HIGH_ZOOM_LAYER_ID, + constants.PRIORITIZED_HIGH_ZOOM_LAYER_ID, + ] : [ + constants.TRIBAL_LAYER_ID, + constants.TRIBAL_ALASKA_POINTS_LAYER_ID, + ] + } // ****** Callback props: ****** @@ -367,15 +375,16 @@ const J40Map = ({location}: IJ40Interface) => { {/* Load either the Tribal layer or census layer */} { + // Todo: may not need both props... censusSelected ? : - + } {/* This will add the navigation controls of the zoom in and zoom out buttons */} diff --git a/client/src/components/MapTribalLayer/MapTribalLayer.tsx b/client/src/components/MapTribalLayer/MapTribalLayer.tsx index c8fb932a..9ee53aae 100644 --- a/client/src/components/MapTribalLayer/MapTribalLayer.tsx +++ b/client/src/components/MapTribalLayer/MapTribalLayer.tsx @@ -81,8 +81,9 @@ const MapTribalLayer = ({ /> {/* Alaska layer */} + {/* // Todo: limit zoom in amount */}