kopia lustrzana https://github.com/robhawkes/vizicities
Added a simple layer visibility API
rodzic
cc388b2f9a
commit
4ee8b62cfc
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue