Hello, I have integrated web rotate 360 in my React App having multiple hotspots and click actions on it. I can get click action on hotspots when working in simple custom HTML and JS project, but not have any idea of how to track hotspot click function in my react app.
That's my code in react:
componentDidMount() {
const viewer = WR360.ImageRotator.Create('webrotate360');
viewer.licenseCode = 'your-license-code';
viewer.settings.configFileURL = '/example/car.xml';
viewer.settings.graphicsPath = '/graphics';
viewer.settings.alt = 'Your alt image description';
viewer.settings.responsiveBaseWidth = 800;
viewer.settings.responsiveMinHeight = 300;
viewer.settings.apiReadyCallback = (api, isFullScreen) => {
this.viewerApi = api;
this.viewerApi.images.onDrag(event => {
console.log(`${event.action}; current image index = ${this.viewerApi.images.getCurrentImageIndex()}`);
});
}
viewer.runImageRotator();
}
Please, can any one guide how to tackle click action in react?
That's my code in react:
componentDidMount() {
const viewer = WR360.ImageRotator.Create('webrotate360');
viewer.licenseCode = 'your-license-code';
viewer.settings.configFileURL = '/example/car.xml';
viewer.settings.graphicsPath = '/graphics';
viewer.settings.alt = 'Your alt image description';
viewer.settings.responsiveBaseWidth = 800;
viewer.settings.responsiveMinHeight = 300;
viewer.settings.apiReadyCallback = (api, isFullScreen) => {
this.viewerApi = api;
this.viewerApi.images.onDrag(event => {
console.log(`${event.action}; current image index = ${this.viewerApi.images.getCurrentImageIndex()}`);
});
}
viewer.runImageRotator();
}
Please, can any one guide how to tackle click action in react?