How I can use the leaflet popups events throught CartoDB. I have seen that some events are working like 'click', 'movestart',but 'popupclose' and 'popupopen' are not working. My goal is to do some tasks when the user closes the popup.
Can be the problem that I am using svg in the infowindow?
I am using cartodb.createVis or should I use cartodb.createLayer instead? am I not noticing something?
cartodb.createVis('map', url) .done(function(vis, layers) { layers[1].setInteraction(true); layers[1].on('featureClick', function(e, latlng, pos, data, layerNumber) { cartodb.log.log(e, latlng, pos, data, layerNumber); }); var map = vis.getNativeMap(); map.on('click', function(e) { }); map.on('popupclose', function(e) { var marker = e.popup._source; }); map.on('popupopen', function(e) { var marker = e.popup._source; }); }); }Thanks!
أكثر...
Can be the problem that I am using svg in the infowindow?
I am using cartodb.createVis or should I use cartodb.createLayer instead? am I not noticing something?
cartodb.createVis('map', url) .done(function(vis, layers) { layers[1].setInteraction(true); layers[1].on('featureClick', function(e, latlng, pos, data, layerNumber) { cartodb.log.log(e, latlng, pos, data, layerNumber); }); var map = vis.getNativeMap(); map.on('click', function(e) { }); map.on('popupclose', function(e) { var marker = e.popup._source; }); map.on('popupopen', function(e) { var marker = e.popup._source; }); }); }Thanks!
أكثر...