seisobs-webapp/www/external/leaflet.easyPrint.js

29 lines
716 B
JavaScript
Raw Normal View History

2014-09-16 13:23:01 +02:00
L.Control.EasyPrint = L.Control.extend({
options: {
position: 'topright',
title: 'Print map',
},
onAdd: function () {
var container = L.DomUtil.create('div', 'leaflet-control-easyPrint leaflet-bar leaflet-control');
this.link = L.DomUtil.create('a', 'leaflet-control-easyPrint-button leaflet-bar-part', container);
this.link.href = 'javascript:void($("#map").print({stylesheet:"external/easyPrint.css"}))';
return container;
},
_click: function (e) {
L.DomEvent.stopPropagation(e);
L.DomEvent.preventDefault(e);
},
});
L.easyPrint = function() {
return new L.Control.EasyPrint();
};