Skip to content

Interaction Lost at Fractional Zoom #236

@grid-100

Description

@grid-100

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

_onMouseMove: function (e) {
	
	if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; }
	console.log(this.getOffset());
	var point = this._map.mouseEventToLayerPoint(e).subtract(this.getOffset());
	this._handleMouseHover(e, point);
},

I notice that at integer zoom where mouseover and click works, the values of this.getOffset() varies between

top-left	{x: -579, y: -428},
bottom-right	{x: 445, y: 84}

When mousewheelzoom / scrolling occurs and map get fractional zoom those values start to jump somewhere between

topleft		{x: -519731, y: -337424}
bottom-right	{x: -518707, y: -336912}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions