A leaflet plugin which adds an icon to print the map - http://rowanwins.github.io/leaflet-easyPrint/
HTML
Latest commit 77d57fb Feb 1, 2017 @rowanwins Update readme
Permalink
Failed to load latest commit information.
dist Add mouse pointer for icon Feb 1, 2017
LICENSE Added MIT license Jan 5, 2016
README.md Update readme Feb 1, 2017
index.html update demo page Feb 1, 2017
package.json Add a package.json to register with npm Feb 1, 2017

README.md

leaflet-easyPrint

A simple leaflet plugin which adds an icon to print the map. Compatible with both Leaflet v1+ and 0.7.

Check out the demo.

Download

You can either download this repo directly or install via NPM.

    npm install leaflet-easyprint

Usage

Step 1. Include the required js files in your document.

    <script src="dist/leaflet.easyPrint.js"></script>       

Step 2. Add the following line of code to your map script

L.easyPrint().addTo(map)

Step 3. You can pass a number of options to the plugin to control various settings.

Option Type Default Description
title string 'Print map' Sets the text which appears as the tooltip of the print button
position Leaflet control position 'topleft' Position the print button
elementsToHide string none Enables you to pass through a string of html elements to hide when the user prints the page

Here's an example of passing through some options.

L.easyPrint({
    title: 'My awesome print button',
    position: 'bottomright',
    elementsToHide: 'p, h2'
}).addTo(map);

Acknowledgements

Huge hats off go to mourner and all the contributors to the leaflet.js project, it's an amazing piece of open source software!

And finally thanks to IcoMoon for the print icon.