makinacorpus / Leaflet.FileLayer

Loads files locally (GeoJSON, KML, GPX) as layers using HTML5 File API
http://makinacorpus.github.io/Leaflet.FileLayer/
MIT License
270 stars 91 forks source link

Fix to work with Leaflet 1.1 #45

Closed thorinii closed 6 years ago

thorinii commented 7 years ago

Leaflet 1.1.0 switched to using Rollup as their bundler tool. It broke a number of plugins that depended on being able to install things in namespaces like L.Util. Leaflet.FileLayer was affected because it installs L.Util.FileLoader and L.Util.fileLoader.

This commit moves those into a new namespace: L.FileLayer.

It also changes the tests to adjust to where Rollup puts the Leaflet distribution.

See Leaflet/Leaflet#5589.

leplatrem commented 7 years ago

Thanks!

Since L.Control.FileLayerLoad() is not changed, I don't see any problem with your changes.

Does it make mandatory (appart from tests) to use Leaflet 1.1 ?

thorinii commented 7 years ago

I don't believe so. The main code should work fine with original Leaflet versions.

Afaik the tests should too - the Travis script builds against 0.7.7 and succeeded. Apparently the Leaflet dist build has always been there and works fine.

leplatrem commented 6 years ago

@SBats heads up?

SBats commented 6 years ago

Thanks a lot @thorinii for this PR! Really appreciated! @leplatrem I don't work at makina anymore so I don't have much time to look on it but I'll try to review this one quickly as it's something really needed by the community. Thanks for the heads up!

SBats commented 6 years ago

Looks good to me. It indeed works with both Leaflet 0.7.x and 1.1.x, so perfect! I'll merge it right away and update demo, package.json etc... Once again, thank you a lot @thorinii for this PR! Great Job! 👍

thorinii commented 6 years ago

Np thanks mate.

camillemonchicourt commented 6 years ago

Great. Since it workd with Leaflet 1.1, we will use it with GeoNature v2 (https://github.com/PnX-SI/GeoNature/issues/256)