Custom Leaflet layer that extends Polygon layer by exposing a .getBitmap() method for exporting bitmap of drawn polygon.
When the layer draws a polygon to canvas, it stores a Path2D object which can be used to create an offscreen canvas which in turn can be used for exporting bitmap
It works by monkey patching the renderer's canvas context to spy on the path methods.
Custom Leaflet layer that extends Polygon layer by exposing a
.getBitmap()
method for exporting bitmap of drawn polygon.When the layer draws a polygon to canvas, it stores a Path2D object which can be used to create an offscreen canvas which in turn can be used for exporting bitmap
It works by monkey patching the renderer's canvas context to spy on the path methods.