Leaflet.print | Leaflet map using either Mapfish or the GeoServer print | Map library
kandi X-RAY | Leaflet.print Summary
kandi X-RAY | Leaflet.print Summary
This plugin is inspired by the printing features of the [GeoExt] library. It also borrows from the visual style of the [Leaflet.draw] plugin.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Callback for the container actions
- Display the layout bar
Leaflet.print Key Features
Leaflet.print Examples and Code Snippets
Community Discussions
Trending Discussions on Leaflet.print
QUESTION
I'm working with leaflet and pure JS/jQuery to make a choropleth map and i've a problem when i try to export it to a local file as PNG/PDF/etc. I want to save the map directly in the main folder, pressing a control print button
, editing the default output path if it is possible.
In leaflet documentation appear four plugins to make it:
using
Leaflet.print
: i couldn't apply it, maybe for my little knowledge in js/leaflet/mapfish to use it. There is no page demo available to see how works. Then i opened the html example on github, index.html, to see how works, but it is used Mapfish to make the print, using ainfo.json
file... I have a layergroup using two jsons to paint and colour polygons, as you can see in the JSFiddle link below.using
Leaflet-image
: i applied it and it generated a map, only with the base of mapbox, at right side of the original map using a topright button.using
Leaflet-easyPrint
: it works: generate the control button at topleft (OK, i like the button!) and print the map BUT in the print preview it doesn't show the legend colours.using
leaflet.browser.Print
: similar as easyPrint in demo, but i do not want the whole browser view. I only want the map, so i didn't try it.
Also, i tried a jQuery print plugin using map div id, but the export map had not the colour legend (and i want to save in a local file).
Therefore, is there a way to do it? If you can explain it to me step-by-step i would be very grateful.
This is a JSFiddle applying leaflet-easyPrint
and leaflet-image
.
ANSWER
Answered 2017-Jun-22 at 07:37I think your best option here is to go with easyPrint. It does have the issue you are mentioning, see: https://github.com/rowanwins/leaflet-easyPrint/issues but as far as i can tell they are supposed to be solved in the V2 branch: https://github.com/rowanwins/leaflet-easyPrint/tree/v2 Changes are undocumented so far, so to find out what's changed you need to go through the issues i posted before.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Leaflet.print
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page