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

Correct _getExpandedVisibleBounds for Max Latitude #587

Merged
merged 3 commits into from
Oct 26, 2015

Conversation

ghybs
Copy link
Contributor

@ghybs ghybs commented Oct 25, 2015

Following #512, created a new private method in MCG _checkBoundsMaxLat that corrects output of _getExpandedVisibleBounds when the latter reaches the CRS projection maximum latitude (typically for Web/Spherical Mercator).

In that case, it extends the latitude to Infinity (or -Infinity in Southern hemisphere) so that all markers and clusters beyond the limit are added to the map. Indeed, when user adds markers directly to the map (not through MCG), if their latitude is above the limit, the projection will floor their position to the limit, so they will be visible within the map.

Without the correction, the map view bounds (even expanded) never reaches the very high latitudes, and MCG never adds markers and clusters at those positions. Hence they are never visible, even though they are counted as children of clusters at low zoom levels.

Also added 4 dedicated unit tests in removeOutsideVisibleBoundsSpec suite.

to avoid hiding markers above the Web Mercator projection maximum latitude (or below minimum latitude) whereas when the same markers are used outside MCG, Leaflet shows them at that limit.
Resolved issue with removeOutsideVisibleBoundsSpec test suite that covers the correction for maximum latitude.

Also slightly improved comments of private method _checkBounds
Changed from _checkBounds to more descriptive _checkBoundsMaxLat.
danzel added a commit that referenced this pull request Oct 26, 2015
Correct _getExpandedVisibleBounds for Max Latitude
@danzel danzel merged commit 050145c into Leaflet:master Oct 26, 2015
@danzel
Copy link
Member

danzel commented Oct 26, 2015

👍

@ghybs ghybs deleted the maxLatitude branch November 13, 2015 13:03
@danzel danzel mentioned this pull request Dec 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants