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

Decorators drawn outside of line boundaries when zoomed out #86

Open
crowmagnumb opened this issue Jul 2, 2018 · 2 comments
Open

Decorators drawn outside of line boundaries when zoomed out #86

crowmagnumb opened this issue Jul 2, 2018 · 2 comments

Comments

@crowmagnumb
Copy link

I have a line decorator defined as ...

    arrows = L.polylineDecorator(latlngs, {
        color: "#107d9f",
        patterns: [
            {
                offset: 40,
                repeat: 80,
                symbol: L.Symbol.arrowHead({
                    pixelSize: 15,
                    pathOptions: { fillOpacity: 1, weight: 0 }
                })
            }
        ]
    });

... which results in this which is fine except for a few stray arrows drawn ...

screen shot 2018-07-02 at 10 47 05 am

... but further zoomed out looks like this ...

screen shot 2018-07-02 at 10 46 25 am

In both cases it should not draw any arrows if they don't fit within the bounds of the line. Not sure how to make this happen. By choosing an offset of zero it helped. Arrowheads still drawn but at least they were clustered near the points. But that doesn't look good zoomed in.

crowmagnumb added a commit to animalus/Leaflet.PolylineDecorator that referenced this issue Jul 2, 2018
@crowmagnumb
Copy link
Author

I have submitted a pull request that fixes this for me.

@jb2b38
Copy link

jb2b38 commented Oct 12, 2018

Having the exact same problem, this pull request fixes the bug.

plepe added a commit to plepe/Leaflet.PolylineDecorator that referenced this issue Nov 12, 2018
plepe added a commit to plepe/Leaflet.PolylineDecorator that referenced this issue Nov 12, 2018
plepe added a commit to plepe/Leaflet.PolylineDecorator that referenced this issue Nov 12, 2018
briquet added a commit to Polyconseil/Leaflet.PolylineDecorator that referenced this issue Sep 12, 2019
briquet added a commit to Polyconseil/Leaflet.PolylineDecorator that referenced this issue Sep 12, 2019
briquet added a commit to Polyconseil/Leaflet.PolylineDecorator that referenced this issue Sep 12, 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

No branches or pull requests

2 participants