Added a simple layer visibility API

feature/threejs-update
Robin Hawkes 2016-10-07 13:58:45 +01:00
rodzic cc388b2f9a
commit 4ee8b62cfc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1EC4C2D6765FA8CF
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -123,6 +123,16 @@ class Layer extends EventEmitter {
return this._options.outputToScene;
}
// TODO: Also hide any attached DOM layers
hide() {
this._object3D.visible = false;
}
// TODO: Also show any attached DOM layers
show() {
this._object3D.visible = true;
}
// Destroys the layer and removes it from the scene and memory
destroy() {
if (this._object3D && this._object3D.children) {

Wyświetl plik

@ -347,6 +347,17 @@ class TileLayer extends Layer {
tile.destroy();
}
show() {
this._stop = false;
this._calculateLOD();
super.show();
}
hide() {
this._stop = true;
super.hide();
}
// Destroys the layer and removes it from the scene and memory
destroy() {
if (this._tiles.children) {