Am 06.04.2022 12:40, schrieb Luca Bertoncello:
Hi again
> I already tried html2canvas. Even slower....
> I'll search other plugins.
I found this project:
https://github.com/hersle/leaflet-route-print
It seems very good, but currently I have a problem in the Javascript and
I cannot solve it (I'm not a big expert in Javascript)...
I include the file so:
<script src="
https://unpkg.com/lea...@1.3.1/dist/leaflet.js"
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script>
<script type="module"
src="
http://my.server.intra/leaflet-route-print.js"></script>
then I try to instanciate the constructor:
var map = L.map('map', {preferCanvas:
true}).setView([51.134333333333, 13.768], 10);
....
var routePrinter = new L.Control.PrintRouteControl();
routePrinter.addTo(map);
as explained in the documentation.
It does not work and always give me the error:
Uncaught TypeError: L.Control.PrintRouteControl is not a constructor
<anonymous> file:///tmp/i/index.html:300
Can someone say me what I'm doing wrong?
Thanks
Luca