Update AK layer id

- make AK layer clickable
This commit is contained in:
Vim USDS 2022-08-11 06:51:11 -07:00
commit bac8c85a6c
3 changed files with 18 additions and 7 deletions

View file

@ -84,7 +84,7 @@ const J40Map = ({location}: IJ40Interface) => {
const [transitionInProgress, setTransitionInProgress] = useState<boolean>(false);
const [geolocationInProgress, setGeolocationInProgress] = useState<boolean>(false);
const [isMobileMapState, setIsMobileMapState] = useState<boolean>(false);
const [censusSelected, setCensusSelected] = useState(true);
const [censusSelected, setCensusSelected] = useState<boolean>(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 ?
<MapTractLayers
selectedFeature={selectedFeature}
selectedFeatureId={selectedFeatureId}
/> :
<MapTribalLayer
selectedFeature={selectedFeature}
selectedFeatureId={selectedFeatureId}
/>
<MapTribalLayer
selectedFeature={selectedFeature}
selectedFeatureId={selectedFeatureId}
/>
}
{/* This will add the navigation controls of the zoom in and zoom out buttons */}

View file

@ -81,8 +81,9 @@ const MapTribalLayer = ({
/>
{/* Alaska layer */}
{/* // Todo: limit zoom in amount */}
<Layer
id={constants.SELECTED_FEATURE_BORDER_LAYER_ID}
id={constants.TRIBAL_ALASKA_POINTS_LAYER_ID}
source-layer={constants.TRIBAL_SOURCE_LAYER}
filter={['==', ['geometry-type'], 'Point']}
type='circle'

View file

@ -204,6 +204,7 @@ export const FEATURE_BORDER_LAYER_ID = 'feature-border-layer-id';
export const SELECTED_FEATURE_BORDER_LAYER_ID = 'selected-feature-border-layer-id';
export const TRIBAL_LAYER_ID = 'tribal-layer-id';
export const SELECTED_TRIBAL_FEATURE_BORDER_LAYER_ID = 'selected-feature-tribal-border-layer-id';
export const TRIBAL_ALASKA_POINTS_LAYER_ID = 'tribal-alaska-points-layer-id';
// Used in layer filters:
export const SCORE_PROPERTY_LOW = 'M_SCORE';