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

Renderer pane option is ignored on canvas renderer #33

Closed
mobinseven opened this issue Nov 2, 2020 · 4 comments
Closed

Renderer pane option is ignored on canvas renderer #33

mobinseven opened this issue Nov 2, 2020 · 4 comments

Comments

@mobinseven
Copy link

Issue Description:

When defining a renderer for the curve, which has a pane defined, pane is ignored and each curve creates a canvas for itself and makes the page very heavy and irresponsible.

Steps to reproduce:

  1. Create a pane.
  2. Create a canvas renderer for the pane.
  3. Create high number of curves with the renderer
map.createPane("customPane");
var canvasRenderer = L.canvas({pane:"customPane"});
var pathOptions = {
                renderer: canvasRenderer 
            };
var path = 
            ['M', [50.14874640066278, 14.106445312500002],
                'Q', [51.67255514839676, 16.303710937500004],
                [50.14874640066278, 18.676757812500004],
                'T', [49.866316729538674, 25.0927734375]];
for (var i = 0; i < 500; i += 1) {
	var curvedPath = L.curve(path, pathOptions);
	curvedPath.addTo(map);
}

Version

Leaflet 1.7.1

@elfalem
Copy link
Owner

elfalem commented Nov 13, 2020

Thanks for the bug report and detailed reproduction steps. I have not yet gotten a chance to investigate but will do so when possible.

@elfalem
Copy link
Owner

elfalem commented Nov 23, 2020

To give an update, I've been able to confirm the issue. It looks like each curve was creating it's own canvas for isolation. This is because animating becomes challenging with multiple curves on the same canvas. But as noted, having multiple canvases also has its own issues. I'm working on getting animations to work reliably on a single canvas.

@elfalem
Copy link
Owner

elfalem commented Nov 24, 2020

@mobinseven I've just released version 0.7.0 which I believe resolves this issue. Please let me know if you can confirm.

@mobinseven
Copy link
Author

@elfalem Yes, I tested the snippet and they all rendered on a single canvas. Thanks!

@elfalem elfalem closed this as completed Nov 27, 2020
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