UNPKG

@loaders.gl/i3s

Version:
34 lines 1.22 kB
// loaders.gl // SPDX-License-Identifier: MIT // Copyright vis.gl contributors import { DataViewReadableFile } from '@loaders.gl/zip'; import { parseSLPKArchive } from "./lib/parsers/parse-slpk/parse-slpk.js"; // __VERSION__ is injected by babel-plugin-version-inline // @ts-ignore TS2304: Cannot find name '__VERSION__'. const VERSION = typeof "4.4.2" !== 'undefined' ? "4.4.2" : 'latest'; /** * Loader for SLPK - Scene Layer Package (Archive I3S format) * @todo - this reloads the entire archive for every tile, should be optimized * @todo - this should be updated to use `parseFile` and ReadableFile */ export const SLPKLoader = { dataType: null, batchType: null, name: 'I3S SLPK (Scene Layer Package)', id: 'slpk', module: 'i3s', version: VERSION, mimeTypes: ['application/octet-stream'], extensions: ['slpk'], options: { slpk: { path: '', pathMode: undefined } }, parse: async (data, options = {}) => { const archive = await parseSLPKArchive(new DataViewReadableFile(new DataView(data))); return archive.getFile(options.slpk?.path ?? '', options.slpk?.pathMode); } }; //# sourceMappingURL=i3s-slpk-loader.js.map