Closed grid-100 closed 3 years ago
@grid-100 I believe this issue and #174 may both be caused by mouse event locations being calculated using the zoom of the tiles, not the map. I have opened a PR to fix this: #252.
@zmbc, perfect! Just tested your fix #252 and my tangram+L.VectorGrid layering works fine now.
@grid-100 How did you get this to work? I pull down that PR and with zoomSnap: .25 click or mouse events didn't work at fractional zoom.
I manually replaced the L.Canvas.Tile from Leaflet.VectorGrid.js with @zmbc code attempt to fix the issue: https://github.com/zmbc/Leaflet.VectorGrid/blob/master/src/Leaflet.Renderer.Canvas.Tile.js. It didn't fix all fractional zoom. But i find it suffice for my current test.
This 174 issue might be similar with hope that the issues will be fixed in the next release.
I've been sucessfully testing VectorGrid to render custom data (electricity network cables) using Leaflet.Vector Grid v1.3 + Leaflet 1.4. Network cables was added as overlay and rendered with Leaflet.VectorGrid. This arrangement allows me to have dynamic combination between basemap and overlays. Everything looks great with standard basemap. The problems arise when I try to use Nextgen-tilezen (using tangram). At fractional zoom, the mouse event seems to be losing its grip from the data.
Using Leaflet.hash as a clue and this Leaflet.VectorGrid.js log at
I notice that at integer zoom where mouseover and click works, the values of
this.getOffset()
varies betweenWhen mousewheelzoom / scrolling occurs and map get fractional zoom those values start to jump somewhere between
I always get normal mouseover interaction whenever i strip down fractional zoom from browser address bar. Do you think
getOffset
return sort of string concatenation? I don't have any idea how to fix it