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

Just one <path> element #28

Open
Azbesciak opened this issue May 16, 2022 · 2 comments
Open

Just one <path> element #28

Azbesciak opened this issue May 16, 2022 · 2 comments

Comments

@Azbesciak
Copy link

Hello, did you consider approach to provide just one <path> element instead of the separate one for every arrow? Maybe it would improve the performance because in my case I have hundred of arrows.

  • textpath even after optimization is not enough - just because of SVG, it freezes my screen.
  • Polylinedecorator is better because it at least renders and allows some interaction, but lags when I change view - same as your lib.

So I assume it is also about the elements count; the best solution would be to use webgl but, we are in leaflet. So maybe limitting the elements size is the solution? Without any arrows (just a polyline) there is no lag in my case.

@slutske22
Copy link
Owner

There is probably a lot of ways to significantly optimize leaflet-arrowheads. I'm sure its possible to do what you're saying, but I really don't have the bandwidth ATM to to that kind of overhaul. I haven't noticed any lag, but I haven't pushed the limits how how many arrows I've tried to draw. Perhaps preferCanvas would help?

I'll leave this open for awhile and think about it.

@Azbesciak
Copy link
Author

I tried some time ago prefer canvas in my app, and it did not change a lot (anything) so I even did not thnik about it. Hovever, i fetched decoratepolyline source code and added "batch" path, and the inprove is significant - a lot less object to track for example.

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