rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/
MIT License
248 stars 137 forks source link

Fire event on print operation failure #136

Open JoshGx2000 opened 10 months ago

JoshGx2000 commented 10 months ago

In the situation where the print operation fails, it'd be nice for a leaflet event to be fired signifying this (e.g. "easyPrint-failed" to go alongside "easyPrint-start" and "easyPrint-finished").

Currently there is no way of telling if a print operation has failed, because all errors are caught and only logged to console.

The use case of this is having an application enter one state when "easyPrint-start" is fired to then return to the original state on "easyPrint-finished" (or "easyPrint-failed"). Without a way to detect errors, the application is stuck in the state where it thinks easyPrint is still printing.