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

resolve trapezoidal distortion issues with project() instead of .latLngToLayerPoint() #341

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

jywarren
Copy link
Member

WIP fix for part of #301 #85

@jywarren jywarren changed the title project() instead of .latLngToLayerPoint() resolve trapezoidal distortion issues with project() instead of .latLngToLayerPoint() Jul 10, 2019
@jywarren
Copy link
Member Author

@sashadev-sky this was a partial solution, i think? Should we merge this to narrow the issue?

@sashadev-sky
Copy link
Member

@jywarren
Woah so glad I decided to look over this tonight! I am pretty sure it completely fixes scale. Walking through it, I think it makes sense.

  • We get the center of the image using latLngToLayerPoint because that calculation is done relative to the image itself
  • but we have to project the coordinates so that they are relative to the absolute pixel coordinates, then do the calculations, then unproject. Basically because the image lives in the context of the map so any calculations involving projecting it over the map need to use project

Going to merge.. and try to write some tests for this 👍Did you say there was a 2nd problem with scale?

@sashadev-sky
Copy link
Member

@jywarren Also, I was tempted to bump the package # but we are starting to do that more often than not for PRs. I was wondering if that is a common practice for non-breaking bugs for a library that is meant to be used as a dependency? It's a little confusing for me because I understand that some libraries fix the bugs but wait until a batch of updates to release before publishing?

@sashadev-sky sashadev-sky merged commit a2d6ac3 into publiclab:main Aug 9, 2019
@jywarren
Copy link
Member Author

jywarren commented Aug 9, 2019 via email

@sashadev-sky
Copy link
Member

@jywarren I don't feel compelled to use it unless you would like to! Maybe we should revisit this after publishing version 1?

@jywarren
Copy link
Member Author

jywarren commented Aug 14, 2019 via email

themacboy pushed a commit to themacboy/Leaflet.DistortableImage that referenced this pull request Sep 19, 2019
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