-
Notifications
You must be signed in to change notification settings - Fork 52
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
Question on using for Leaflet #17
Comments
I fail to see what using Leaflet would accomplish. Leaflet uses pre-rendered raster tiles, so the resolution isn't configurable, defeating the purpose of this tool (I never considered Leaflet when creating this tool because of this). If you just want to save the view, a quick search shows that there are existing tools for doing so. |
Your tool offers other advantages, the first is it allows the user to customize the size of the map. I got that part going. The other is it seems to use a hidden element to render the map. That's the part I'm trying to figure out. If I could configure the dpi it still it would be nice even if as you say there would be zero impact on a rasterized image. There's a discussion on how to use html2canvas to increase the dpi of an image at: niklasvh/html2canvas#241 The other Leaflet print/image plugins have issues with Internet Explorer, which is why I'm using html2canvas. As you know Leaflet doesn't have the getCanvas() method that the Mapbox GL JS api does. All that aside I'm trying to figure out how to download a png and a pdf from a hidden element in a similar manner to your tool except using Leaflet. |
While I've used Leaflet before, I've never used it for anything like this, so I unfortunately can't be of much help. Leaflet also doesn't use |
Well, thanks for the input anyway. I think I'm making some progress on it now. Perhaps, if I get it done I'll post a fiddle. I'm still playing with it, but I'm going to try to fake it by adding another hidden div which will contain a second map object, unhide it, add it to the canvas, generate the png and pdf, then rehide it. If it happens fast enough the user won't be aware of the second div. Feel free to close the issue if you have no more comments. Thanks again. |
I know there's probably not an easy answer, but I thought I would ask anyway. Is there a way to use this tool for leaflet instead of mapbox-gl?
I have no trouble bringing the map into the panel-body map-container. I have issues when I try to export the map to png or pdf in the createPrintMap function. Here's what I got so far:
The png downloads but only shows the very bottom of the map at the top of the screen. If I shrink the browser screen to 25% I get a complete (but shrunken) image. I know this tool was made for mapbox-gl but I thought I would ask anyway to see if you had approached this challenge with Leaflet in the past. I know this is a question and not an issue. Thanks for your time.
The text was updated successfully, but these errors were encountered: