Geo-Web-Project / cadastre

Map-based interface for claiming, buying, and managing Geo Web land parcels.
https://geoweb.land/
MIT License
25 stars 15 forks source link

feat: use only ID for URL based parcel navigation #423

Closed tnrdd closed 1 year ago

tnrdd commented 1 year ago

Description

Navigate to a parcel from an URL using only the parcel ID without the coordinates.

Issue

fixes #408

Checklist:

Additional comments

The useParcelNavigation custom hook takes an optional parcelId argument and returns some functions used to resolve the ID to GPS coordinates and to navigate to the parcel. This replaces the current way to do parcel navigation from the modals allowing us to imperatively call Mapbox's flyTo from the event handler and avoid some rerender caused by setState and useEffect.

Alert Reviewers

@codynhat @gravenp