generated from NYCPlanning/ae-remix-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter projects by community district
Only show capital projects that fall within a community district Highlight the selected community district with its geojson layer closes #63
- Loading branch information
1 parent
8123436
commit 542e68b
Showing
7 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { useCapitalProjectsLayer } from "./useCapitalProjectsLayer.client"; | ||
export { useCommunityDistrictsLayer } from "./useCommunityDistrictsLayer.client"; | ||
export { useCommunityDistrictLayer } from "./useCommunityDistrictLayer.client"; | ||
export { useCityCouncilDistrictsLayer } from "./useCityCouncilDistrictsLayer.client"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app/components/layers/useCommunityDistrictLayer.client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { GeoJsonLayer } from "@deck.gl/layers"; | ||
import { useParams } from "@remix-run/react"; | ||
|
||
export function useCommunityDistrictLayer() { | ||
const { boroughId, communityDistrictId } = useParams(); | ||
const hasCommunityDistrict = | ||
boroughId !== undefined && communityDistrictId !== undefined; | ||
const data = hasCommunityDistrict | ||
? `${import.meta.env.VITE_ZONING_API_URL}/api/boroughs/${boroughId}/community-districts/${communityDistrictId}/geojson` | ||
: []; | ||
|
||
return new GeoJsonLayer({ | ||
id: "CommunityDistrict", | ||
data, | ||
visible: hasCommunityDistrict, | ||
filled: false, | ||
stroked: true, | ||
lineWidthUnits: "pixels", | ||
getLineWidth: 3, | ||
getLineColor: [49, 151, 149], | ||
}); | ||
} |
3 changes: 3 additions & 0 deletions
3
app/routes/boroughs.$boroughId.community-districts.$communityDistrictId.capital-projects.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function CapitalProjectsByBoroughIdCommunityDistrictId() { | ||
return <></>; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters