shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
722 stars 289 forks source link

Very poor performance with KML transparency #241

Open f00dl3 opened 8 years ago

f00dl3 commented 8 years ago

When setting a KML to have a alpha color value, the L.KML will render the KML layer transparent, but it suffers severe performance issues.

If the KML is referencing a animated GIF, the animation is not smooth - even on a 8-core 4790k w/ 16 GBs of RAM and Ubuntu 16.04. Performance is even worse on Android. Without the override in the KML, performance is smooth. It's the alpha transparency that causes the issues.

Let me know what if any logs could be of use to help isolate why KML transparency / alpha is such a CPU hog...

brunob commented 8 years ago

Do you play with a simple placemark icon or a groundoverlay ? I think it would be same if you put your gif as a simple image overlay since it's what is doing the kml script on leaflet map.

f00dl3 commented 8 years ago

It's a ground overlay. https://github.com/f00dl3/Samples/blob/master/RadarB.kml

brunob commented 8 years ago

As i said, groundoverlay use a simple image overlay, so i'm pretty sure that your map would be laggy with the same image as a leaflet image overlay. Can you try this on a fiddle ?

brunob commented 8 years ago

Just tested your kml, and from my side it works well and smoothly...