@mcolabs/threebox-plugin 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcolabs/threebox-plugin",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "description": "A Three.js plugin for Mapbox GL JS, using the CustomLayerInterface feature. Provides convenient methods to manage objects in lnglat coordinates, and to synchronize the map and scene cameras.",
6
6
  "main": "dist/threebox.cjs",
@@ -43,10 +43,16 @@ function loadObj(options, cb, promise) {
43
43
  break;
44
44
  }
45
45
 
46
- materialLoader.withCredentials = options.withCredentials;
47
- materialLoader.load(options.mtl, loadObject, () => (null), error => {
48
- console.warn("No material file found " + error.stack);
49
- });
46
+ // Only load MTL if specified, otherwise proceed directly
47
+ if (options.mtl) {
48
+ materialLoader.withCredentials = options.withCredentials;
49
+ materialLoader.load(options.mtl, loadObject, () => (null), error => {
50
+ console.warn("No material file found " + error.stack);
51
+ loadObject(null); // Proceed without materials on error
52
+ });
53
+ } else {
54
+ loadObject(null); // No MTL specified, proceed directly
55
+ }
50
56
 
51
57
  function loadObject(materials) {
52
58