Merge pull request #2 from robhawkes/bug/interaction-events

Fix interaction event bug
pull/3/head
Robin Hawkes 2019-02-15 14:24:56 +00:00 zatwierdzone przez GitHub
commit fd3170921c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
9 zmienionych plików z 10438 dodań i 3067 usunięć

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7556
dist/vizicities.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -134,16 +134,21 @@ class PointLayer extends Layer {
// Get unique ID for picking interaction
_setPickingId() {
this._pickingId = this.getPickingId();
this._pickingId = this._options.pickingId = this.getPickingId();
}
// Set up and re-emit interaction events
_addPickingEvents() {
// TODO: Find a way to properly remove this listener on destroy
this._world.on('pick-' + this._pickingId, (point2d, point3d, intersects) => {
this._world.on('pick-click-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('click', this, point2d, point3d, intersects);
});
this._world.on('pick-hover-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('hover', this, point2d, point3d, intersects);
});
}
static SetBufferAttributes(coordinates, options) {

Wyświetl plik

@ -134,16 +134,21 @@ class PolygonLayer extends Layer {
// Get unique ID for picking interaction
_setPickingId() {
this._pickingId = this.getPickingId();
this._pickingId = this._options.pickingId = this.getPickingId();
}
// Set up and re-emit interaction events
_addPickingEvents() {
// TODO: Find a way to properly remove this listener on destroy
this._world.on('pick-' + this._pickingId, (point2d, point3d, intersects) => {
this._world.on('pick-click-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('click', this, point2d, point3d, intersects);
});
this._world.on('pick-hover-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('hover', this, point2d, point3d, intersects);
});
}
// Create and store reference to THREE.BufferAttribute data for this layer

Wyświetl plik

@ -130,16 +130,21 @@ class PolylineLayer extends Layer {
// Get unique ID for picking interaction
_setPickingId() {
this._pickingId = this.getPickingId();
this._pickingId = this._options.pickingId = this.getPickingId();
}
// Set up and re-emit interaction events
_addPickingEvents() {
// TODO: Find a way to properly remove this listener on destroy
this._world.on('pick-' + this._pickingId, (point2d, point3d, intersects) => {
this._world.on('pick-click-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('click', this, point2d, point3d, intersects);
});
this._world.on('pick-hover-' + this._pickingId, (point2d, point3d, intersects) => {
// Re-emit click event from the layer
this.emit('hover', this, point2d, point3d, intersects);
});
}
static SetBufferAttributes(coordinates, options) {