Hi! I investigated the issue why hover and hoverOff methods are never triggered for Glify lines...
Upon debugging static method tryHover in lines.ts I noticed that when it checks whether the hover point in inBounds(e.latlng, bounds) it accepts invalid (impossible) bounds, like the following ones:
{
"_southWest": {
"lat": -185.939713,
"lng": 24.563612
},
"_northEast": {
"lat": -66.970467,
"lng": 71.27343
}
}
It looks like lat and lng are mixed up.
After further investigation I also noticed that bounds constant in the TryHover method receiving incorrect input data, array of data.features instead of the featureCollection object,
const bounds = geoJSON(data.features).getBounds();
instead of
const bounds = geoJSON(data).getBounds();
I'm still testing it, then will prepare a patch / pull request if everything good...
UPD. data.features are not the issue, Leaflet's geoJSON() accept both array or object, so it's just micro optimization. But the real issue is that Leaflet's getBounds() returns bounds (lat/lng) in different sequence than expected for WebGL. lat/lng should be just swapped. This seems easier than swap lat/lng in all features of input data.
Or alternatively, something different should be used instead of Leaflet's getJSON().
Hi! I investigated the issue why
hoverandhoverOffmethods are never triggered for Glify lines...Upon debugging static method
tryHoverinlines.tsI noticed that when it checks whether the hover point ininBounds(e.latlng, bounds)it accepts invalid (impossible) bounds, like the following ones:It looks like
latandlngare mixed up.After further investigation I also noticed that
boundsconstant in theTryHovermethod receiving incorrect input data, array of data.features instead of the featureCollection object,const bounds = geoJSON(data.features).getBounds();instead of
const bounds = geoJSON(data).getBounds();I'm still testing it, then will prepare a patch / pull request if everything good...
UPD.
data.featuresare not the issue, Leaflet'sgeoJSON()accept both array or object, so it's just micro optimization. But the real issue is that Leaflet'sgetBounds()returns bounds (lat/lng) in different sequence than expected for WebGL. lat/lng should be just swapped. This seems easier than swap lat/lng in all features of input data.Or alternatively, something different should be used instead of Leaflet's
getJSON().