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

How to use javascript to add new hot spots? #1166

Open
yongliancai opened this issue May 30, 2023 · 2 comments
Open

How to use javascript to add new hot spots? #1166

yongliancai opened this issue May 30, 2023 · 2 comments
Labels

Comments

@yongliancai
Copy link

I want to use javascript to add new hot spots, and can add it pitch yaw text in web
How can I do?

@mpetroff
Copy link
Owner

mpetroff commented Jun 6, 2023

The addHotSpot method is what you're looking for. If you create your viewer with var viewer = pannellum.viewer(...);, you can add a hot spot to the current scene with

viewer.addHotSpot({
    "pitch": 10,
    "yaw": 10,
    "type": "info",
    "text": "some text here"
});

If you want to add it to a different scene, you can provide the scene ID as the second argument to the method.

@guohuayu
Copy link

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'push')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants