Improved Minimun Zoom implementation strategy #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-Before, the minimum Zoom level to perform clustering was defined by the property 'minLongitudeDeltaToCluster'. The problem With this approach is that the equivalent value for 1 degree of Longitude values vary (according to latitude values) from 0 meters in the poles, to 111319.46 meters in the equator. This means that if we set:
minLongitudeDeltaToCluster = 1.0If the latitude is 90 or -90, it will ALWAYS perform clustering, and if the latitude is 0, it will perform clustering when we zoom out the equivalent to 111 Kilometers.
On the other hand, Latitude distances does not vary in such a big way, and are therefore a better way to reference the current level of zoom.
-Based on this principle, I've added the property
The ideal thing would be to completely remove the minLongitudeDeltaToCluster property, but considering compatibility issues, it's been Deprecated:
Right Now the algorithm considers BOTH parameters when evaluating the zoom level, but on the next release it should only use the minLatitudeDeltaToCluster value.
I hope it was helpful =)