rowanwins / leaflet-easyPrint

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty file on first click

dario85-dev opened this issue · comments

    this.printControl = (L as any).easyPrint({
        title: 'Print Me',
        position: 'bottomleft',
        sizeModes: ['Current'],
        filename: this.uid,
        exportOnly: true,
        tileWait: 4000,
        hidden: true,
        hideControlContainer: true
    }).addTo(this.map);


    this.printControl.printMap('CurrentSize');

Screenshot 2020-10-30 at 10 50 16

if i trigger button a second time the map is downloaded correctly.

Can you share the Current object you're trying to use?

Like this:

 const currentView = { 
    width: $("#map").width(),
    name: 'Current View',
    height: $("#map").height(),
    className: 'MyClassName',
    tooltip: 'Current View Port'
  }