diff --git a/src/hud/search-box.js b/src/hud/search-box.js index 7d1a3a6..e3566c2 100644 --- a/src/hud/search-box.js +++ b/src/hud/search-box.js @@ -149,7 +149,8 @@ function doSearch (str) { idList.push(results[i].satId); } - const dispGroup = new SatGroup('idList', idList); + const dispGroup = new SatGroup('search-results', 'Search Results', 'idList', idList); + dispGroup.reload(); lastResultGroup = dispGroup; app.groups.selectGroup(dispGroup); diff --git a/src/viewer/orbit-display.js b/src/viewer/orbit-display.js index 34405f2..d8586ec 100644 --- a/src/viewer/orbit-display.js +++ b/src/viewer/orbit-display.js @@ -127,14 +127,19 @@ function draw (pMatrix, camMatrix) { // lol what do I do here if (app.groups.selectedGroup) { gl.uniform4fv(pathShader.uColor, groupColor); const satellites = app.groups.selectedGroup.sats; - satellites.forEach((id) => { - gl.bindBuffer(gl.ARRAY_BUFFER, glBuffers[id]); - gl.vertexAttribPointer(pathShader.aPos, 3, gl.FLOAT, false, 0, 0); - gl.drawArrays(gl.LINE_STRIP, 0, NUM_SEGS + 1); + satellites.forEach((satellite) => { + const id = satellite.satId; + if (glBuffers[id]) { + gl.bindBuffer(gl.ARRAY_BUFFER, glBuffers[id]); + gl.vertexAttribPointer(pathShader.aPos, 3, gl.FLOAT, false, 0, 0); + gl.drawArrays(gl.LINE_STRIP, 0, NUM_SEGS + 1); + } else { + logger.warn(`glBuffers[${id}] is undefined`); + } }); } - // gl.depthMask(true); + // gl.depthMask(true); gl.disable(gl.BLEND); } diff --git a/src/viewer/sat-groups.js b/src/viewer/sat-groups.js index 5394023..8c57c5c 100644 --- a/src/viewer/sat-groups.js +++ b/src/viewer/sat-groups.js @@ -37,6 +37,10 @@ class SatGroups { return this.groups[groupId]; } + getSelectedGroup () { + return this.selectedGroup; + } + reloadGroups () { const keys = Object.keys(this.groups); for (let i = 0; i < keys.length; i++) {