manubb / Leaflet.PixiOverlay

Bring Pixi.js power to Leaflet maps
MIT License
463 stars 85 forks source link

Stop propagation #81

Open luojinzhang opened 1 year ago

luojinzhang commented 1 year ago

Hi guys, I am having a problem with pixi marker. So when I click on the marker, the event is not stopped and keep going through to leaflet layer. I have been looking through in Pixi forum but it doesn't work. Method I have tried:

markerSprite.on('mouseup', (e) => {
              if (moveCount < 2 && onClick) {
                e.stopPropagation();
                onClick(id);
              }
            });

I wonder if anyone know how to solve this. Thank you.

nebsar commented 1 year ago

Try: markerSprite.on('mouseupoutside', (e) => { if (moveCount < 2 && onClick) { e.stopPropagation(); onClick(id); } });