You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inside my PrepareLeafletMarker override function, which I made following this example.
However, 'popupopen' never gets fired, nor does its dual 'popupclose', while 'click' does.
I need this to set a listener on the popup content once it is open.
I don't really get why...
The text was updated successfully, but these errors were encountered:
I did a quick test and I can reproduce the problem. I don't know why it doesn't work, it could be something related to Leaflet and how the markers are created by PruneCluster. I don't have the time to investigate the problem but I can suggest a workaround : by listening to popupopen events on the map object like this:
leafletView.PrepareLeafletMarker=function(leafletMarker,data){varpopup=leafletMarker.getPopup();if(!popup){popup=L.popup();leafletMarker.bindPopup(popup);}popup.setContent(data.popup);// Attach the data objectpopup.data=data;};map.on('popupopen',function(e){if(e.popup.data){alert(e.popup.data.something);}});
Hi, great job!
I'm trying to listen to http://leafletjs.com/reference.html#marker-popupopen
inside my PrepareLeafletMarker override function, which I made following this example.
However, 'popupopen' never gets fired, nor does its dual 'popupclose', while 'click' does.
I need this to set a listener on the popup content once it is open.
I don't really get why...
The text was updated successfully, but these errors were encountered: