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

Fix mouse events on overzoomed canvas tiles

Open zmbc opened this issue 3 years ago • 0 comments

When using maxZoom and maxNativeZoom to "overzoom" tiles to higher zoom levels, the existing Canvas.Tile logic incorrectly calculates where the mouse is within the tile, because it does not scale the real pixels to the canvas' pixels, which are now 2, 4, 8, etc times larger. This means that features cannot be hovered or clicked on.

This commit adds logic to scale offsets and mouse locations according to the overzoom factor, which restores the behavior of non-overzoomed tiles.

zmbc avatar Dec 12 '20 04:12 zmbc