Skip to content

Commit

Permalink
feat(react-components): Add event functions to click and hover 360 im…
Browse files Browse the repository at this point in the history
…ages (#4802)

* Initial commit

* Upgrade Reveal to 4.18.0

* chore: update visual test image

---------

Co-authored-by: Håkon Flatval <[email protected]>
  • Loading branch information
nilscognite and haakonflatval-cognite authored Oct 18, 2024
1 parent e47a5e5 commit 6e1b053
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"peerDependencies": {
"@cognite/cogs-lab": "^9.0.0-alpha.111",
"@cognite/reveal": "4.17.0",
"@cognite/reveal": "4.18.0",
"react": ">=18",
"react-dom": ">=18",
"styled-components": ">=5"
Expand All @@ -46,7 +46,7 @@
"@cognite/cdf-utilities": "^3.6.0",
"@cognite/cogs-lab": "^9.0.0-alpha.113",
"@cognite/cogs.js": "^10.25.0",
"@cognite/reveal": "^4.17.0",
"@cognite/reveal": "^4.18.0",
"@cognite/sdk": "^9.13.0",
"@playwright/test": "1.48.0",
"@storybook/addon-essentials": "8.3.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ export class NavigationTool extends BaseTool {
return { key: 'NAVIGATION', fallback: 'Navigation' };
}

public override onHover(event: PointerEvent): void {
this.renderTarget.viewer.onHover360Images(event);
}

public override async onClick(event: PointerEvent): Promise<void> {
await this.cameraManager.onClick(event);
if (!(await this.renderTarget.viewer.onClick360Images(event)))
await this.cameraManager.onClick(event);
}

public override async onDoubleClick(event: PointerEvent): Promise<void> {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions react-components/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e1b053

Please sign in to comment.