Skip to content
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

Merged
merged 2 commits into from
Dec 15, 2020

Conversation

kinduff
Copy link
Contributor

@kinduff kinduff commented Oct 10, 2020

Why

Fixes #753, since the initial map view was not displaying all the offers.

Pre-Merge Checklist

  • All new features have been described in the pull request
  • Security & accessibility have been considered
  • All outstanding questions and concerns have been resolved
  • Any next steps that seem like good ideas have been created as issues for future discussion & implementation
  • High quality tests have been added, or an explanation has been given why the features cannot be tested
  • New features have been documented, and the code is understandable and well commented
  • Entry added to CHANGELOG.md if appropriate

Regarding the CHANGELOG, not sure if I should do it. Please advice.

What

  • Uses bounds extender with processed markers in order to have all bounds and fit the map
  • Uses padding to avoid cutting off the icons (see screenshot attached)

image

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

  • Not sure if I should change the CHANGELOG myself.
  • I'm really worried about the performance of the 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

@maebeale
Copy link
Collaborator

👋 @kinduff ! yes please re changelog.

@maebeale
Copy link
Collaborator

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!)

@kinduff
Copy link
Contributor Author

kinduff commented Oct 10, 2020

@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.

@solebared
Copy link
Collaborator

@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.

@kinduff
Copy link
Contributor Author

kinduff commented Dec 12, 2020

@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.

@solebared
Copy link
Collaborator

@kinduff, you're so right! Turns out i had fetched your branch but not switched to it when testing! 🤦
My bad, this is perfect and i'll merge it shortly! 🙏🏾
(And i appreciate your grace in responding kindly 😇).

@solebared solebared merged commit 67d7dfc into rubyforgood:main Dec 15, 2020
@kinduff kinduff deleted the feature/initial_map_view branch December 15, 2020 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zoom initial map view
4 participants