zhuang-hao-ming / Leaflet.RoughCanvas

Leaflet.RoughCanvas is a plugin for render hand-drawn style vector map on leaflet.
90 stars 10 forks source link

Leaflet.RoughCanvas stops working when used with Leaflet 1.6.0 #4

Open pranavranadive opened 4 years ago

pranavranadive commented 4 years ago

Hi Team,

We have been using Leaflet.RoughCanvas library along with Leaflet 1.5 to draw polygon shapes on map in Salesforce JavaScript. We recently have updated the Leaflet library to Leaflet 1.6.0 then, Leaflet.RoughCanvas stops working.

We did initial analysis and found that it is giving undefined error at below line in Library. Line 1655 - this._drawnLayers[layer._leaflet_id] = layer;

where the "_drawnLayers" comes as "undefined".

Need your help to quickly fix this issue.

Thanks, Pranav Ranadive

anurag0486 commented 4 years ago

Hi,

Please can we have an update on the issue. Is there a solution to it as I am also stuck on the same.

Thanks Anurag Sharma

anurag0486 commented 4 years ago

Hi All, We have still not found the work around for the same. If anyone has do let us know.

Thanks

chakflying commented 4 years ago

I've got a basic version working on my fork, basically changing _drawnLayers to _layers would work, but it still needs a lot of work to be production ready, like there is no babel setup for IE, and leaflet event on("click") doesn't work for some reason, I guess because the rough.js canvas is covering the container?

[Edit] After much battling with babel and polyfills, IE11 support has been added on my fork. The on("click") issue still exists tho. I suspect I need to dive deeper into how the svg renderer works, which I really don't have the knowledge of.