Popup with hover flickers

253 views
Skip to first unread message

Jason Winshell

unread,
Dec 31, 2013, 11:29:16 PM12/31/13
to leafl...@googlegroups.com
Hello,

I've implemented popup on a circle as:

// use a plain old circle as a marker so I can
// control color, etc
var marker = L.circle([value[1], value[0]], 150);

var popup = L.popup ();
popup.setContent ("some text here);
marker.bindPopup (popup);

marker.on ('mouseover', function (e) {
    var target = e.target;
    e.target.openPopup();
    console.log ("mouse over");
});

marker.on ('mouseout', function (e) {
    e.target.closePopup();
    console.log ("mouse out");
});

It works fine except for one annoying behavior. When the mouse roams near the popup balloon but still within the boundary of the circle underneath it, a mouseout event is generated for the circle. This leads, naturally, to closing the popup. The behavior  is clearly caused the front to back hit testing for the circle and the popup. When I offset the popup outside the circle I get no such behavior. How can I keep a mouseout event from being generating on the circle when the mouse rolls over the displayed popup.

Thanks.




Jeff Ceriello

unread,
Jul 22, 2015, 1:17:06 PM7/22/15
to Leaflet
Hi Jason, I've encountered the same issue. Did you find a solution for this?

Thanks

Jeff
Reply all
Reply to author
Forward
0 new messages