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 for WMS on Leaflet when using Polar stereographic #5618

Merged
merged 15 commits into from
Oct 27, 2017

Conversation

scaddenp
Copy link
Contributor

This is the patch proposed in #5617

Copy link
Member

@perliedman perliedman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thanks for this!

I read this quickly, and it looks like you have identified the same problems as in kartena/Proj4Leaflet#149 - it also looks like this fix indeed addresses this problem in a sensible way.

However, this pull request currently breaks the tests, and from the looks of it the code as it is now contains some syntax errors. Check the details here: https://travis-ci.org/Leaflet/Leaflet/builds/251868759?utm_source=github_status&utm_medium=notification

@scaddenp
Copy link
Contributor Author

scaddenp commented Jul 10, 2017 via email

@scaddenp
Copy link
Contributor Author

Boy that system is fussy about indents. All of them done. Now that I have figured out how this system works, it is rather nice. Is there way to run the integration checks on my fork before making a pull request?

@scaddenp
Copy link
Contributor Author

Was rather hoping for a way to use github travis. Our build/test environment is very different so a lot of unfamiliar tools to install. (starting with npm). Anyway, seems to have got past the checks. ESRI fix has real issues (as opposed to style) so looking more carefully at that now.

Copy link
Member

@perliedman perliedman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is looking good! I know the linting can be a bit painful when starting to work with Leaflet, but it's there for good reason so we ensure a consistent style throughout the whole code base, something I think has served us well in the long run.

I made another remark which I think needs to be addressed before merging, to make the code a bit cleaner and easier to read (even though you added good comments!), hope this seems right to you!

nw = this._crs.project(tileBounds[0]),
se = this._crs.project(tileBounds[1]);
// in polar projections NS lat/lon box might reversed (S 'above' N) so check and swap if need be
if (se.y > nw.y) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will look cleaner if you just turn nw and se into a Bounds instance, that will automatically handle swapping around coordinates. You can then either access them through min and max properties or its various methods for getting each of the bound's four corners.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I can see how this would work okay with projected coordinates - using a bounds object with the lat/long was part of the original trouble.

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.

3 participants