-
-
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 Controls to Map Page #1793
Comments
This ticket is ready to be picked up |
Assigning this to @DrAcula27 based on conversation from earlier in the day. @DrAcula27 please provide the following information:
Thank you! |
ETA: 10 September |
Updated ETA: 17 September
Availability: weekdays after 2pm Pacific time |
Finally finished the large issue for the website team 🚀
|
@ryanfchase Availability:
|
ETA: October 11 with a check-in on the 2nd via either GitHub or Slack. |
Help Wanted
Questions
What am I missing here?
|
@DrAcula27 I think that setting pointer events to none was definitely preventing the cursor styles from being applied. I actually removed both these lines (from their respective blocks): zoomInButton.style.pointerEvents = 'none'; // remove this
zoomInButton.style.cursor = 'not-allowed'; // remove this I then simply zoomed in until I hit the max zoom level, and the I've done some digging into programmatically setting min + max zooms. I cannot find any documentation on this, HOWEVER, you can simply call You'll notice that when activating an NC, we frame the camera around that NC's bounding box. To get this exact zoom level, I think you can call Update: I worry there is some funkiness of grabbing Another approach would be to prevent panning beyond the NC's bounding box. To do this, you can call ResourcesA single geojson Feature: {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
} Source on setting max bounds: https://stackoverflow.com/questions/61523571/how-to-fit-bounds-and-set-max-bounds-at-same-time-on-window-resize-in-mapbox Where to find all NC geojson: |
I've just remembered that in the design ticket (#1700 (comment)) we specified to use a max zoom of 18, and a min zoom of 9 when an NC is selected. PMs will want to check this behavior and determine if it is good enough. To avoid complexity mentioned above, feel free to move forward with these hard-coded zoom values before worrying about NC bounding boxes or pan areas. |
Update to tooltip text:
|
Observation:
|
Observation:
|
ETA Update:
|
In the PR, #1843, I suggested a different approach. I'll list in more detail how to implement my suggestion: On map load, we'd like to wrap a zoom control with the Tooltip component. This lets us reuse styles that we've utilized for the Datepicker tooltip, etc.
ResourcesMUI Docs NPM Stack Overflow |
Also, I have another approach which is slightly simpler. It is detailed below, but note that you cannot utilize any of the styles defined in our React components. We'll need to significantly modify the CSS to match the specs.
Resources |
Updated ETA
|
@ryanfchase I've got the tooltip implemented, but with default styles. Let me know if I should make the PR as-is, or if I should work on implementing style changes. Proposed styles according to Figma
Current default styles from MUI
|
@DrAcula27 let's give design a little more time to review and officially hand off their work. In the meantime, please prepare all of your work in your PR and prepare for official review. I think you've done a lot of good work, I'd like to get these changes into the codebase before our Vite migration on Wednesday (10/30). The code for styling for this design will come in a separate ticket, most likely. |
For updating the styles of the tooltip: https://mui.com/material-ui/react-tooltip/#customization |
I've provided my review. @DrAcula27 please move this ticket to |
Overview
We need to add zoom controls to our map page to improve accessibility and make it clear when user has an NC selected.
Overview
Resources (R)
1.1 design ticket: Improve Zoom Behavior on Map #1700
1.2 comment with screenshot of figma notes
1.3 Comment with screenshot of zoom controls (final)
1.4 Figma Link
2.1 Docs example of setting zoom levels
2.2 Navigation Control Docs
2.3 Custom styles for mapbox controls
3.1 Slide indicating users required a zoom in/out feature
PM Review Section
Screenshot before proposed changes
TODO: Screenshot after proposed changes
[insert screenshot here]
Resolved Dependency Info
Dependency (Resolved)
The text was updated successfully, but these errors were encountered: