Picking layers should now hide with layer

feature/threejs-update
Robin Hawkes 2016-10-21 14:30:52 +01:00
rodzic 4b40d98029
commit df8ce96e4c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 1EC4C2D6765FA8CF
3 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -1093,11 +1093,11 @@ class GeoJSONWorkerLayer extends Layer {
// Set up and re-emit interaction events
_addPicking(pickingId, properties) {
this._world.on('pick-click-' + pickingId, (pickingId, point2d, point3d, intersects) => {
this._world.emit('click', this, properties);
this._world.emit('click', this, properties, point2d, point3d);
});
this._world.on('pick-hover-' + pickingId, (pickingId, point2d, point3d, intersects) => {
this._world.emit('hover', this, properties);
this._world.emit('hover', this, properties, point2d, point3d);
});
}

Wyświetl plik

@ -126,11 +126,19 @@ class Layer extends EventEmitter {
// TODO: Also hide any attached DOM layers
hide() {
this._object3D.visible = false;
if (this._pickingMesh) {
this._pickingMesh.visible = false;
}
}
// TODO: Also show any attached DOM layers
show() {
this._object3D.visible = true;
if (this._pickingMesh) {
this._pickingMesh.visible = true;
}
}
// Destroys the layer and removes it from the scene and memory

Wyświetl plik

@ -349,12 +349,22 @@ class TileLayer extends Layer {
show() {
this._stop = false;
if (this._tilesPicking) {
this._tilesPicking.visible = true;
}
this._calculateLOD();
super.show();
}
hide() {
this._stop = true;
if (this._tilesPicking) {
this._tilesPicking.visible = false;
}
super.hide();
}