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

interpolateOnLine doesn't return correct predecessor #66

Closed
luiscamachopt opened this issue Feb 27, 2017 · 7 comments
Closed

interpolateOnLine doesn't return correct predecessor #66

luiscamachopt opened this issue Feb 27, 2017 · 7 comments
Assignees
Labels

Comments

@luiscamachopt
Copy link

L.GeometryUtil.interpolateOnLine(myw.app.map, [L.latLng(1, 2), L.latLng(3, 4)], 0.5).predecessor
returns -1 when it should be 0

This happens when point is in first segment.

@leplatrem
Copy link
Collaborator

Thanks for reporting!

This should be fairly to reproduce in a test case. Would you mind submitting a pull-request?

@leplatrem leplatrem added the bug label Mar 14, 2017
@eric7472
Copy link

Hi,
It seems to be the same issue than #32.
Please find enclosed a test case. The problem is very dependent of the angle between segment.

interpolateBug.html.zip

@jb2b38
Copy link

jb2b38 commented Mar 13, 2018

I have a fix for this, but I get a 403 when trying to submit a pull request.

@mdartic
Copy link
Member

mdartic commented Mar 13, 2018

Do you create a PR from a private repo ? I can't see your fork in your repositories.

@jb2b38
Copy link

jb2b38 commented Mar 13, 2018

My bad, I cloned it to my computer from URL. PR created, thanks for pointing me in the right direction.

@mdartic
Copy link
Member

mdartic commented Mar 15, 2018

Thank you @jb2b38 for your PR.

@eric7472 @luiscamachopt could you check if the fix made by @jb2b38 fix your bug ?

Please clone https://github.com/jb2b38/Leaflet.GeometryUtil/tree/fix_66 .

@mabhub
Copy link
Member

mabhub commented Jun 22, 2018

Just for a link to be made between issue & PR : #76

mdartic added a commit that referenced this issue Jun 26, 2018
* Fix `interpolateOnLine()` doesn't return correct predecessor (#66, thanks @jb2b38)
* Add `angle()` and `destinationOnSegment()` (#71, thanks @trandaison)
* migrate mocha to 5.2.0 following instructions on npm audit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants