-
Notifications
You must be signed in to change notification settings - Fork 1
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
Don't require "preferCanvas" #2
Comments
Thank you, I see that it isn't really needed to configure the whole map with Ideally, though, I would like the library to function in a WYSIWYG-manner and relieve the user of thinking about such technical requirements. I suppose the only way to achieve this would be to clone a general map (rendered with a mix of SVG and Canvas renderers) to a seemingly identical map in which all layers are recreated and rendered with the Canvas renderer. But my instincts tell me that this is not the right way to go about things, would be inefficient and inelegant, and perhaps is not even possible. A middleway and straightforward approach could be to clone only the polyline of the route that is to be printed, but then details such as line color, line thickness and other elements such as markers would not be included, in general. Do you have any ideas on handling this, either from the "internal" perspective of the library, or the "external" point of view of its users? |
Yes, that's fine.
I actually thought you were doing that, but passing the route (
My first thought was, that client-side printing should be using a vector tile renderer, which already renders everything in a WebGL canvas and would allow to render sharp images at exactly 300 dpi. We just recently included MapLibre GL JS with MapLibre GL Leaflet and use dynamic The problem is, that there are no free vector tile providers and that there is only a limited number of styles available, which also lack the detail of raster styles like openstreetmap-carto. |
The readme says:
var map = L.map("map", {preferCanvas: true}); // IMPORTANT: preferCanvas must be true!
This is a bit of a no-go for me. I tried that before and reverted because moving vectors was laggy. It can also have unintended side effects for other plugins.
What is
preferCanvas
needed for?leaflet-image doesn't really require that:
The text was updated successfully, but these errors were encountered: