Skip to content

Commit

Permalink
feat: make overlay initialization array optional and bump Reveal vers…
Browse files Browse the repository at this point in the history
…ion to 4.15.1 (#4640)

* feat: make overlay initialization array optional

* chore: add fallback for undefined array

* chore: revert optional-change, instead set reasonable maximum

* chore: bump reveal version te 4.15.1
  • Loading branch information
haakonflatval-cognite authored Jun 25, 2024
1 parent 92f9323 commit 3f72f50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion viewer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cognite/reveal",
"version": "4.15.0",
"version": "4.15.1",
"description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
"homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion viewer/packages/3d-overlays/src/Overlay3DCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ export class Overlay3DCollection<MetadataType = DefaultOverlay3DContentType>
private readonly _rayCaster = new Raycaster();
private readonly _cameraChangeDebouncer = new CameraChangeThrottler();

/**
* Construct a collection of 3D overlay icons
*
* @param overlayInfos Initializes the collection with the list of overlays. The length
* of the list will be the maximum allowed number of icons in this collection, unless it's empty,
* in which case a default maximum limit will be used instead
* @param options Additional options for this overlay collection
*/
constructor(overlayInfos: OverlayInfo<MetadataType>[], options?: Overlay3DCollectionOptions) {
super();

Expand All @@ -69,7 +77,7 @@ export class Overlay3DCollection<MetadataType = DefaultOverlay3DContentType>
};

this._overlayPoints = new OverlayPointsObject(
overlayInfos ? overlayInfos.length : this.DefaultMaxPoints,
overlayInfos.length > 0 ? overlayInfos.length : this.DefaultMaxPoints,
{
spriteTexture: this._sharedTextures.color,
maskTexture: this._sharedTextures.mask,
Expand Down

0 comments on commit 3f72f50

Please sign in to comment.