Skip to content

Commit

Permalink
feat: default map layer to visible
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsier committed Oct 30, 2024
1 parent 05c5fff commit 619969a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion client/src/components/Map/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ class PraxisMap extends Component {
</div>
</Popup>
)}
<Source id="zips" type="geojson" data={zips}>
<Source
id="zips"
type="geojson"
data={zips || { type: "FeatureCollection", features: [] }}
>
<Layer key="zips-layer" {...zipsLayer} />
<Layer key="zips-label" {...zipsLabel} />
</Source>
Expand Down
9 changes: 8 additions & 1 deletion client/src/reducers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ export default function searchState(state = initialSearchState, action) {
case UPDATE_SEARCH_PARAMS:
return {
...state,
searchParams: { ...state.searchParams, ...action.payload },
searchParams: {
...state.searchParams,
...action.payload,
searchYear:
state.searchParams.searchYear ||
action.payload.searchYear ||
DEFAULT_YEAR,
},
}
case UPDATE_PRIMARY_SEARCH:
return {
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function createFilterFromParams(params) {
if (layerFilter.length > 0) {
return ["all", ...layerFilter]
} else {
return ["none"]
return ["all"]
}
}

Expand Down
3 changes: 0 additions & 3 deletions client/src/utils/parseURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export function URLParamsToSearchParams(searchQuery) {
case "address":
searchTerm = place
break
default:
console.error(`Unkown search type:${searchType}`)
break
}

return {
Expand Down

0 comments on commit 619969a

Please sign in to comment.