Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: printer.easyPrint is not a function at eval in typescript #119

Open
yog3sha opened this issue Oct 26, 2020 · 1 comment

Comments

@yog3sha
Copy link

yog3sha commented Oct 26, 2020

I am unable to find easyPrint function to call it in typescript.
I have created leaflet map in my Vue+TS app using component imports as follows
import { LMap, LTileLayer, LMarker, LPopup, LIcon, LControl } from "vue2-leaflet"; import 'leaflet-easyprint'; import { EasyPrintControl, EasyPrintOptions } from '../../leaflet-easyprint';

And I am trying to print map as follows:
`
const printer = L.easyPrint({
hidden: false,
exportOnly: false
});

printer.easyPrint({
  hidden: false,
  exportOnly: false
});

`

@dario85-dev
Copy link

i've done like this in angular

import * as L from 'leaflet';
import 'leaflet-easyprint';

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants