Leaflet.BigImage icon indicating copy to clipboard operation
Leaflet.BigImage copied to clipboard

Several problems in code

Open vagran opened this issue 4 years ago • 1 comments

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).

vagran avatar Oct 03 '20 06:10 vagran

I'm also maintaining my own fork in a project, mostly for the z-order and scale issues OP mentioned in this ticket.

folknor avatar Mar 30 '21 20:03 folknor