GithubHelp home page GithubHelp logo

jerry-goodboy / leaflet-easyprint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rowanwins/leaflet-easyprint

0.0 0.0 0.0 39 KB

A leaflet plugin which adds an icon to print the map - http://rowanwins.github.io/leaflet-easyPrint/

License: MIT License

HTML 100.00%

leaflet-easyprint's Introduction

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.

leaflet-easyprint's People

Contributors

kyleladd avatar rowanwins avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.