Leaflet.Canvas-Flowmap-Layer icon indicating copy to clipboard operation
Leaflet.Canvas-Flowmap-Layer copied to clipboard

Add function for mouseover lines

Open oijkn opened this issue 6 years ago • 2 comments

Hello,

With the current code we can use the mouseover function on the circleMarkers, origin and destination points but it's impossible to have this feature for the lines.

Could you add this feature, please ?

Thank you for your support.

oijkn avatar Apr 30 '19 13:04 oijkn

I don't know yet if that will be possible without substantial additional work. But, I welcome pull requests with code enhancements to support this!

The lines are drawn in a pure <canvas> that is handled outside of LeafletJS. Any user interaction events for the bezier lines would require some research and likely writing a bit of new code.

jwasilgeo avatar Jun 04 '19 15:06 jwasilgeo

There's been some more interest shown in supporting this enhancement. Here are some more notes in case I or anyone else ends up researching this some more.

Might want to look into: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#Hit_regions (but they're experimental)

Also might be useful to find out how LeafletJS source code to see how they wired up mouse interactions, popups, tooltips, etc. when they render features on the canvas.

jwasilgeo avatar Feb 10 '20 19:02 jwasilgeo