-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fit all the offers in the initial view for the map #774
Conversation
👋 @kinduff ! yes please re changelog. |
Agree re Contributions controller. We're going to be refactoring it anyway bc we need to mix in Community Resources data, so, don't think we need a new Issue for that. Is that something you'd want to take on? (Could def use the help on it!) |
@maebeale Thanks for the clarification, the CHANGELOG is now updated. Re Contributions, would love to help! Let me know what's on your mind and will contribute for sure. |
@kinduff , appreciate your work on this and apologies for the long delay getting to it. The changes here look good in terms of ensuring the map expands to fit existing contributions. However they don't solve the other part of this, which is to zoom in so that the initial view of the map is as narrow as possible while still fitting all contributions. This is preferable because most/all mutual aid groups serve a specific locality (a ward, city or region) and so starting with the whole U.S as a default is always going to be too wide. So for example, if all contributions are in and around Philadelphia, then the initial view of the map should narrow in on the city. If, on the other hand all contributions are within the Shaw neighborhood of DC, then the initial view should zoom into just that neighborhood, more or less. Does that make sense? I'm happy to merge what you have since it does solve one part of this problem, even though not the whole issue. |
@exbinary Hello! Just for the sake of the context and to try to understand what the missing part of the issue is. What's missing from this PR? What I did is to calculate the existing contributions on the map and fit the view (zoom in) as better as possible, so if all contributions are just in one city, the zoom will display the city in question. |
@kinduff, you're so right! Turns out i had fetched your branch but not switched to it when testing! 🤦 |
Why
Fixes #753, since the initial map view was not displaying all the offers.
Pre-Merge Checklist
Regarding the CHANGELOG, not sure if I should do it. Please advice.
What
How
It uses LngLatBounds and it's method
extend
in order to have a bound box that later can be set to fit the map.Testing
N/A
Next Steps
N/A
Outstanding Questions, Concerns and Other Notes
contributions_controller
. There are a lot of queries to the database that we should be able to either use a JOIN, an INCLUDES, etc.Accessibility
N/A
Security
N/A
Meta
N/A