I want to move the mouse over an specific line of the polylines and get data of that line. I've been trying this for a while with no success, here is my code:
var allHover = L.polyline([
[
[45.51, -122.68],
[37.77, -122.43],
[34.04, -118.2]
],
[
[40.78, -73.91],
[41.83, -87.62],
[32.76, -96.72]
]
], {
color: 'rgba(0,0,0,0)',
weight: 15
}).addTo(map);
allHover.on('mouseover', function(e) {
var info = e.target;
console.log(info);
});
allHover.on('mouseout', function() {
console.log('mouse out');
});
The problem is that instead of getting just the data from one line, I get the full data. How can I solve that?