visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.06k stars 2.08k forks source link

[Bug] Compressed gltf models cannot be used offline #8039

Closed FEJackFly closed 1 year ago

FEJackFly commented 1 year ago

Description

DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://unpkg.com/@loaders.gl/draco@3.4.4/dist/draco-worker.js' failed to load.

How to use offline

Flavors

Expected Behavior

No response

Steps to Reproduce

Compress the model with blender gltf

Disconnect the wireless network

Environment

Logs

No response

Pessimistress commented 1 year ago

https://deck.gl/docs/developer-guide/loading-data#loaders-and-web-workers

FEJackFly commented 1 year ago

new ScenegraphLayer({ id: name + "-layer", data: data[name], pickable: true, scenegraph: "glb/zip/" + name + ".glb", getPosition: (d) => d.position, getOrientation: (d) => [0, d.heading + 0.7, 90], getScale: [1.4, 1.4, 1.4], getTranslation: [0, 0, 0], sizeScale: 1, _lighting: "pbr", opacity: isOpacity ? 0.2 : 1, loaders: [GLTFLoader], loadOptions: { worker: false, }, visible: visible && data[name].length > 0 ? true : false, // coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS, // coordinateOrigin: coordinateOriginLatLon, })

This setting does not take effect