makinacorpus / Leaflet.FileLayer

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

File size limit #67

Open 1stgongsin opened 5 years ago

1stgongsin commented 5 years ago

Input file size limit is now 1024kb In the leaflet.filelayer.js file, I change this value(1024) to 9999, but limit didn't change. Is it impossible to change upper limit of gpx(kml) file size?

leplatrem commented 5 years ago

I don't remember the history of this option... but fileSizeLimit is defined twice in the source file, so maybe you forgot once. And a priori it's an option, so shouldn't have to modify the lib file.

1stgongsin commented 5 years ago

Thank for reply, leplatrem. Over 1Mbytes gpx or kml file does not appear on the map. i think togeojson.js can't process over 1Mbytes size of gpx or kml.

leplatrem commented 5 years ago

i think togeojson.js can't process over 1Mbytes size of gpx or kml.

I doubt it.

Any error in the browser console?

johnd0e commented 5 years ago

but fileSizeLimit is defined twice in the source file,

The second is excessive (IMHO better remove it from FileLayerLoad defaults).

In the leaflet.filelayer.js file, I change this value(1024) to 9999

You should not change source, as the value can be specified in options.

var control = L.Control.fileLayerLoad({ fileSizeLimit: 2048 })

And it works, I've just checked it myself.

a-lurker commented 5 years ago

Great plugin. Had a couple of problems initially. Tried out the demo and a lot of my files didn't show. Started to wonder if the plugin was any good. Had a look in the console - no error messages.

Turns out a lot of my gpx files were over 1024 kb. After messing around, the documentation gave the much needed clue.

Would like to see: 1) The default 1024 kb raised to 2048 kb. I can load 20 files greater than 1mb each and have no problems. There is no max file count so you could still exceed some practical limit. May be a max data amount is needed rather than the 1024kb limit per file. ie load all files and stop loading when the file(s) total amount exceeds say 50mb? 2) An option that writes anything that goes to data:error (error) to the console. Default to enabled. User can then choose to turn console logging off. That would immediately show why larger files are not processed. Would have saved me a lot of time.

Thanks once again for the effort.

leplatrem commented 4 years ago

Please, don't hesitate to open pull-requests!