-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mapbox zoom 1793 v2 #1860
base: main
Are you sure you want to change the base?
Add mapbox zoom 1793 v2 #1860
Conversation
components/Map/zoomTooltip.jsx
Outdated
neighborhood council. | ||
</strong> | ||
<br /> | ||
To reset zoom features, please exit by clicking out of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We needed to change this to say "please exit by clicking the 'x' on the selected NC" or something like that. More discussion incoming at upcoming general meeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the text to: To reset zoom features, please exit the boundary selection by clicking the 'X' on the selected Neighborhood Council within the 'Boundaries' filter of the 'Search & Filters' modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapbox fitBounds
is behaving poorly. Steps to reproduce:
- select an NC (preferably small, e.g. "Greater Valley Glen")
- select another NC (preferably bigger, e.g. "Van Nuys NC")
- notice that we don't get the smooth transition between selected NCs
Explanation:
- we need to unset the min zoom when flying from one NC to another. Mapbox glitches out if it tries flying somewhere, but it can't zoom out properly while flying due to min zoom being too small.
Steps to fix:
- in
components/Map/layers/BoundaryLayer.js
, notice that there is a call tothis.map.fitBounds()
on line ~205- just above that line, set the map's min zoom to our default min zoom
- optionally: move DEFAULT_MIN_ZOOM and DEFAULT_MAX_ZOOM into the constants folder (so we don't need to hard-code it in 2 places)
Example code starting at line ~203 in BoundaryLayer
// zoom to the region
this.map.setMinZoom(9) // here! 9 is DEFAULT_MIN_ZOOM
this.map.fitBounds(boundingBox(geo), { padding: FIT_BOUNDS_PADDING }); // this was already here
@ryanfchase @traycn
|
Fixes #1793
main
branchAny questions? See the getting started guide