Open KonstantinBiryukov opened 2 years ago
@KonstantinBiryukov There is a good tutorial available for the angular module ngx-leaflet. I guess that can be easily adapted for react
https://github.com/bluehalo/ngx-leaflet-tutorial-plugins/tree/master/Leaflet.BrowserPrint
I am curious if it is supposed to work in React + TypeScript? After the package is installed. I am trying to do import
import "leaflet.browser.print/dist/leaflet.browser.print"
Is there anything specific that has to be done to use this library with React + TS?If I just install the package without any import and write
var browserControl = L.control.browserPrint({position: 'topLeft'}).addTo(instance)
, where instance is a Map object it doesn't work. I have an error: Property 'browserPrint' does not exist on type 'typeof control'. TS2339And if I suppress this error, I have
TypeError: Cannot read properties of undefined (reading 'Mode')
How to extend this L.control class by the plugin and use it in React + TS?