Leaflet.BigImage
Leaflet.BigImage copied to clipboard
Several problems in code
Hello, I tried to adopt your code for my needs and found several problems.
https://github.com/pasichnykvasyl/Leaflet.BigImage/blob/b02e8f08783eb3f0ce9c9f11dd1c61bd44eb11d1/src/Leaflet.BigImage.js#L327
this.ctx.scale
https://github.com/pasichnykvasyl/Leaflet.BigImage/blob/b02e8f08783eb3f0ce9c9f11dd1c61bd44eb11d1/src/Leaflet.BigImage.js#L217 This assumes only one tile is drawn at the given index. It is incorrect when you have overlay with semi-transparent or non-square tiles (masked by transparency channel). Probably best approach is just to draw all tiles in z-order. Also check your order, seems base tile is always preferred over overlay.
https://github.com/pasichnykvasyl/Leaflet.BigImage/blob/b02e8f08783eb3f0ce9c9f11dd1c61bd44eb11d1/src/Leaflet.BigImage.js#L242
https://github.com/pasichnykvasyl/Leaflet.BigImage/blob/b02e8f08783eb3f0ce9c9f11dd1c61bd44eb11d1/src/Leaflet.BigImage.js#L216
onerror
should be set as well, otherwise failing to load at least one image will hang whole the process.
Here is my version of export plugin (pure programmatic way, no controls).
I'm also maintaining my own fork in a project, mostly for the z-order and scale issues OP mentioned in this ticket.