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

Use pixels from upper zoom levels #2

Open
IvanSanchez opened this issue Aug 30, 2016 · 2 comments
Open

Use pixels from upper zoom levels #2

IvanSanchez opened this issue Aug 30, 2016 · 2 comments

Comments

@IvanSanchez
Copy link
Member

When shifting a canvas around, it gets clear pixels.

There should be a way to keep canvases from upper levels, and copy the corresponding pixels from there. That should get rid of multiple transparent canvases when some overlapping tiles are being loaded/pruned.

@ebrensi
Copy link

ebrensi commented Apr 2, 2020

Not sure what this means. But I would be down to try if you explain it. I am already using this plugin in my app.

@IvanSanchez
Copy link
Member Author

It means that this piece of code....

level.canvas = L.DomUtil.create(
"canvas",
"leaflet-tile-container leaflet-zoom-animated",
this._container
);

...is creating an empty canvas.

Instead, it should iterate through this._levels, choose one of the existing upper levels, and perform a drawImage() call to copy pixels from an existing level canvas to the most recent level canvas.

Once that's working, implement removal of the pre-existing level (or make it invisible so it caches data??) and catch race conditions (e.g. tiles being loaded to a non-existing level should fail gracefully)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants