loam
loam copied to clipboard
Add ability to open remote files
This could either be accomplished by modifying loam.open()
to detect URLs, or by creating a new method specifically for the purpose of opening remote files.
Either way, the corresponding Emscripten file will need to be created using FS.createLazyFile()
.
FS.createLazyFile()
is not a perfect solution here, because the default implementation downloads a megabyte at a time, which can feel sluggish for users. It may be necessary to add a contribution to GDAL core that makes use of Emscripten's fetch() API: https://groups.google.com/forum/#!topic/emscripten-discuss/gMV6_b6oszQ
Emscripten now has the setting SMALL_XHR_CHUNKS
which may make this work better: https://github.com/emscripten-core/emscripten/blob/5ecd2d9d62fd246525d37a4337cfca858b43e3ef/src/library_fs.js#L1704