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

Implemented (part of) the fix as @obi068 suggested #13

Merged
merged 3 commits into from
Jun 28, 2017
Merged

Implemented (part of) the fix as @obi068 suggested #13

merged 3 commits into from
Jun 28, 2017

Conversation

BartWaardenburg
Copy link
Contributor

@BartWaardenburg BartWaardenburg commented Oct 24, 2016

This solves #1 for me while not breaking the other examples and keeps compatibility with Leaflet 1.x.

@fchabouis
Copy link

This fix seems to have a few problems.
As data is stored in offsetSegments only if dist > 1, I get errors when some code is trying to access the 'offset' property of undefined elements.
I also noticed that dist is computed as a sqrt, but is only used for a comparision with 1.
You could also do:
dist = xs * xs + ys * ys;
if (dist > 1)
which is less costly to compute.

lebnic and others added 2 commits June 13, 2017 11:41
… by @BartWaardenburg should be re-reviewed such that it can be merged in Leaflet.PolylineOffset code
Fixed bugs introduce in commit 422b577; Initial initial PR#13 created…
@bbecquet
Copy link
Owner

Thank you all for this fix! And sorry for being so long to merge :|

@bbecquet bbecquet merged commit 2a38674 into bbecquet:master Jun 28, 2017
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.

4 participants