Skip to content

Conversation

@nathanhuynhers
Copy link
Collaborator

@nathanhuynhers nathanhuynhers commented Apr 27, 2025

What's new in this PR

Description

Nathan's work:

  • Added functionality to draw a polygon on the map based on selected location coordinates.
  • Integrated Google Maps Polygon API into the Apply button flow.
  • Implemented map zoom and center behavior after applying a location filter:
  • The map now fits the polygon bounds using fitBounds().
  • After fitting bounds, the map zooms out slightly for a more comfortable view.
  • Added state management for the current polygon:
  • Old polygons are cleared (setMap(null)) when a new region is applied. Only one polygon is shown at a time.
  • Fixed bug with double apply that Ann found (basically it appeared when you click apply twice and nothing's selected, it would still display two Projects), fixed it by not allowing them to apply if nothing selected the second time.

Ethan's work:

  • integrated queryCoordsForName with Nathan's edits in /LocationCategoryPanel to efficiently pull the coordinates upon applying the location filter
  • found a solution for the "Capital Region" edge case. the data pulled using the API for "Capital Region" for some reason had 3 sets of coordinates, and picking the third set produced the correct shape. we'll def note this in documentation
  • found that the database has polygon and multipolygon typed data + handled data accordingly

Screenshots

image

How to review

  • apply a filter in the location dropdown and ensure that the right shape appears by comparing it with the map corresponding to each of the location filters here.

Next steps

  • realizing the data pulled using the API is quite messy + unreliable, so we def need to be very specific in documentation how to deal with it if the data ever changes with a CRON job

Relevant links

Online sources

Related PRs

CC: @jjstnlee

@nathanhuynhers nathanhuynhers linked an issue Apr 27, 2025 that may be closed by this pull request
@ethan-tam33 ethan-tam33 force-pushed the nathan/179-set-up-location-filter-highlighting branch from 48c0092 to 434f3e1 Compare May 1, 2025 06:50
@ethan-tam33 ethan-tam33 requested a review from jjstnlee May 1, 2025 07:02
Copy link
Collaborator

@jjstnlee jjstnlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hell yea

@jjstnlee jjstnlee merged commit aa491b8 into main May 20, 2025
2 checks passed
jjstnlee added a commit that referenced this pull request May 22, 2025
* updated with sort by

* one line fix

* Set up location filtering logic and zoom in to selection (#183)

* fixed merge confs

* fixed

* functioning efficient querying

* fixed capital region edge case

* fixed location filter bug

* clean

* handle null

* comment

* clean

* changed polygon style

---------

Co-authored-by: Ethan Tam <[email protected]>

* Bump next from 14.2.16 to 14.2.26 (#189)

Bumps [next](https://github.com/vercel/next.js) from 14.2.16 to 14.2.26.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v14.2.16...v14.2.26)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 14.2.26
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* updated with sort by

* one line fix

* fixed sorting with filters

* styling

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nathan Huynh <[email protected]>
Co-authored-by: Ethan Tam <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set Up Location Filter Highlighting

4 participants