Bind hover on mouseover leaflet polyline

774 Views Asked by At

Is there a possibility to bind a mouseover event to a (multi)polyline which shows detailed information to that part of the line? I found some examples for polygons but they do not work on polylines.

This is how my multiPolyline is created. The ajax function loads all coordinates.

$.ajax({
    url: 'getline.php?id=' + q,
    success: function(data) {
        var line = L.multiPolyline(eval('[' + data + ']'), {
            color: 'blue',
            weight: 5,
            smoothFactor: 1,
            opacity: 1
        }).addTo(map);
    }
});
0

There are 0 best solutions below