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

Fix grid max zoom #677

Merged
merged 1 commit into from
Jun 26, 2023
Merged

Fix grid max zoom #677

merged 1 commit into from
Jun 26, 2023

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 13, 2023

The grid also skip clustering if >= maxZoom

if (map.getZoom() >= this.maxZoom) {

We the comparison should be >= instead of >

Some other minor cleanups

Notes:

  • I documented/changed the code base on the implementation of the grid algo. We could also decided that maxZoom should be excluded but it would change the behavior of the grid algo
  • Interestingly I figured that the supercluster does nothing with the max zoom... looks like a bug to me (and already reported as SuperClusterAlgorithm keeps displaying cluster at maximum zoom level #647) edit: it's actually an option of the SuperCluster

@vicb
Copy link
Contributor Author

vicb commented Jun 13, 2023

Note that SuperCluster defines maxZoom as "Maximum zoom level at which clusters are generated."

This is not what is implemented in this CL (ref "We could also decided that maxZoom should be excluded but it would change the behavior of the grid algo" in the initial description).

So first step would be to decide and document what the desired behavior is and then make the corresponding updates in gris/supercluster.

@vicb vicb mentioned this pull request Jun 13, 2023
@wangela
Copy link
Member

wangela commented Jun 26, 2023

Thanks for contributing this fix, @vicb!

@wangela wangela merged commit dceb4c2 into googlemaps:main Jun 26, 2023
googlemaps-bot pushed a commit that referenced this pull request Jun 26, 2023
### [2.3.1](v2.3.0...v2.3.1) (2023-06-26)

### Bug Fixes

* **grid:** max zoom ([#677](#677)) ([dceb4c2](dceb4c2))

### Miscellaneous Chores

* **deps-dev:** bump @googlemaps/js-api-loader from 1.15.2 to 1.16.2 ([#682](#682)) ([d2ca9f5](d2ca9f5))
* **deps-dev:** bump @rollup/plugin-commonjs from 25.0.0 to 25.0.2 ([#679](#679)) ([0f0cb8c](0f0cb8c))
* **deps-dev:** bump @typescript-eslint/parser from 5.59.9 to 5.60.0 ([#681](#681)) ([dc6c06d](dc6c06d))
* **deps-dev:** bump eslint-plugin-jest from 27.2.1 to 27.2.2 ([#680](#680)) ([e4de5b4](e4de5b4))
github-actions bot pushed a commit that referenced this pull request Jun 26, 2023
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 2.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@vicb
Copy link
Contributor Author

vicb commented Jun 26, 2023

@wangela I don't think this should have been merged without resolving the open question in the description and comment - that is grid and clusterer should be consistent.

@wangela
Copy link
Member

wangela commented Jul 25, 2023

@vicb Oops, I missed that in the discussion. Perhaps we should keep PRs in "Draft" state until disussion points are all resolved.

@vicb
Copy link
Contributor Author

vicb commented Jul 25, 2023

I didn't know draft PRs were a thing but yeah that and reading PRs description/comments/notifications would help.
We'll do better next time ;)

Any thoughts on the question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants