teralytics / Leaflet.D3SvgOverlay

Leaflet Plugin: D3 SVG Overlay
MIT License
184 stars 45 forks source link

Leaflet.D3SvgOverlay browser freeze with Leaflet.Draw #37

Open elfflames opened 6 years ago

elfflames commented 6 years ago

I created a leaflet layer by using the "Leaflet.D3SvgOverlay" plugin and geojson data. Later I added a "Leaflet Draw" plugin for drawing polyline, all work correctly but when I zoomIn or zoomOut the browser freeze without any error.

Someone has encountered the same problem?

veryspry commented 4 years ago

Same issue here. Any updates on this?

LeGoffMael commented 3 years ago

did you find any solution to this problem ?

LeGoffMael commented 3 years ago

There is no error in the console so I'm not sure why it crashed, but I found a solution that solves the freeze/crash problem for me:


const svg = L.d3SvgOverlay(function(selection, projection) {
   // your D3 code here 
}, {
   zoomDraw: false // add this to avoid the browser to crash on zoom
});

svg.addTo(map);

I hope this will help someone.