Skip to content

Commit

Permalink
feat(3DTiles) add C3DTILES_LAYER_EVENTS.ON_TILE_REQUESTED
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinMachado authored and jailln committed May 25, 2023
1 parent 36ce64d commit ec837c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Layer/C3DTilesLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ export const C3DTILES_LAYER_EVENTS = {
/**
* Fires when a tile content has been loaded
* @event C3DTilesLayer#on-tile-content-loaded
* @property type {string} on-tile-content-loaded
* @type {object}
* @property {THREE.Object3D} tileContent - object3D of the tile
*/
ON_TILE_CONTENT_LOADED: 'on-tile-content-loaded',
/**
* Fires when a tile is requested
* @event C3DTilesLayer#on-tile-requested
* @type {object}
* @property {object} metadata - tile
*/
ON_TILE_REQUESTED: 'on-tile-requested',
};

const update = process3dTilesNode();
Expand Down
3 changes: 3 additions & 0 deletions src/Process/3dTilesProcessing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as THREE from 'three';
import Extent from 'Core/Geographic/Extent';
import ObjectRemovalHelper from 'Process/ObjectRemovalHelper';
import { C3DTILES_LAYER_EVENTS } from '../Layer/C3DTilesLayer';

/** @module 3dTilesProcessing
*/
Expand All @@ -17,6 +18,8 @@ function requestNewTile(view, scheduler, geometryLayer, metadata, parent, redraw
redraw,
};

geometryLayer.dispatchEvent({ type: C3DTILES_LAYER_EVENTS.ON_TILE_REQUESTED, metadata });

return scheduler.execute(command);
}

Expand Down

0 comments on commit ec837c7

Please sign in to comment.