manubb / Leaflet.PixiOverlay

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

Integration with Existing Leaflet Canvas #6

Closed sgentile closed 6 years ago

sgentile commented 6 years ago

I'm using the utils.getRender inside my code (see below), however, I'm also using leaflet canvas circle markers. When I add my pixiContainer, it adds a second canvas. I end up losing my interactive sprint mousedown events since I have 2 canvas's instead of a shared canvas.

Is there a way to have pixiOverlay use the existing map canvas instead of creating its own ?

Thanks

var renderer = utils.getRenderer();
...
renderer.render(container);
manubb commented 6 years ago

A canvas element cannot be used with both 2d and webgl contexts. IMHO, your best option is to draw your circle markers in the pixiOverlay layer.