@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/dist/threebox.cjs +1 -1
- package/dist/threebox.cjs.map +1 -1
- package/dist/threebox.iife.js +1 -1
- package/dist/threebox.iife.js.map +1 -1
- package/dist/threebox.js +9 -4
- package/dist/threebox.js.map +1 -1
- package/package.json +1 -1
- package/src/objects/loadObj.js +10 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcolabs/threebox-plugin",
|
|
3
|
-
"version": "4.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",
|
package/src/objects/loadObj.js
CHANGED
|
@@ -43,10 +43,16 @@ function loadObj(options, cb, promise) {
|
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|