deepsea 1 year ago
parent
commit
d2d2262b7f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/uwb-sample.js

+ 5 - 1
src/uwb-sample.js

@@ -289,7 +289,11 @@ function getsqlData(sdkInstance, uwbInstance) {
               let textureLoader = new THREE.TextureLoader();
               let benchList = window.store ? window.store.getters['benchList/getBenchList'] : [];
               let currentBench = benchList.find(b => b.id == bench_id);
-              let texture = textureLoader.load('../images/location_'+(currentBench.status || 'offline')+'.png');
+              let purl = '../images/location_offline.png';
+              if (currentBench && currentBench.status) {
+                purl = '../images/location_'+(currentBench.status || 'offline')+'.png'
+              }
+              let texture = textureLoader.load(purl);
 
               // 创建精灵对象
               let spriteMaterial = new THREE.SpriteMaterial({