fix(spatial): loop through correct dictionary

This commit is contained in:
Oscar Lorentzon 2019-10-21 16:18:04 +02:00
parent d3371d45db
commit 98139c304e

View File

@ -251,7 +251,7 @@ export class SpatialDataScene {
}
public uncache(keepHashes?: string[]): void {
for (const hash of Object.keys(this._reconstructions)) {
for (const hash of Object.keys(this._tileClusterReconstructions)) {
if (!!keepHashes && keepHashes.indexOf(hash) !== -1) {
continue;
}
@ -677,17 +677,6 @@ export class SpatialDataScene {
}
private _disposePoints(hash: string): void {
const tilePoints: THREE.Object3D = this._reconstructions[hash].points;
for (const points of tilePoints.children.slice()) {
(<THREE.Points>points).geometry.dispose();
(<THREE.Points>points).material.dispose();
tilePoints.remove(points);
}
this._scene.remove(tilePoints);
for (const key of this._tileClusterReconstructions[hash].keys) {
if (!(key in this._clusterReconstructions)) {
continue;