Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: getCurrentNode() not working #45

Open
1 task
pasta022 opened this issue Dec 29, 2023 · 2 comments
Open
1 task

[Bug]: getCurrentNode() not working #45

pasta022 opened this issue Dec 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@pasta022
Copy link

What happened?

on the photo-sphere-viewer docs, under the virtualTour plugin, there's a method called getCurrentNode which is supposed to return the current node. I used this in react-photo-sphere-viewer after getting an instance of the virtualTour plugin and got an error. I have attached an Image containing the error
Screenshot 2023-12-29 at 03 07 01

What should have happened?

return current node

Code

// create an instance of the plugins
const handleReady = (instance) => {
// marker plugin intance
const markersPluginInstance = instance.getPlugin(MarkersPlugin);

// virtualTour plugin instance
const virtualTourPluginInstance = instance.getPlugin(VirtualTourPlugin);

virtualTourPluginInstance.setNodes(vtplg)
const recNode = virtualTourPluginInstance.getCurrentNode()
console.log(recNode);

if (markerPlug) {
  markerPlug.addEventListener("select-marker", () => {
    console.log("marker clicked");
  });
}

};

Sandbox Link

No response

Library Version

"^3.4.0-psv5.4.0"

What operating system are you using?

macOS

What browser are you using?

Chrome

Logs

No response

Interest to fix the bug

  • I would like to fix this bug!
@pasta022 pasta022 added the bug Something isn't working label Dec 29, 2023
@Elius94
Copy link
Owner

Elius94 commented Dec 29, 2023

Hello! thanks I'll try to figure it out.
I will let you know :)

@pasta022
Copy link
Author

thank you. i have already used the "node-changed" event listener to get my nodeId which is what i was after but it'll still be great to have the method fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants