Use addHotspot in react component
Closed this issue · 3 comments
vakhsakhalyan commented
I would like to add hotspot by clicked on pannellum or in some div.
My code bellow:
`
class App extends Component {
initPanalleum() {
}
componentWillMount() {
ReactPannellum.lookAt(20,10);
}
click() {
let panel = getContainer();
addHotSpot({
"pitch": 14.1,
"yaw": 1.5,
"type": "info",
"text": "Baltimore Museum of Art",
"URL": "https://artbma.org/"
}, "firstScene");
console.log(getConfig());
}
render() {
const config = {
autoLoad: true
}
return (
<div>
<ReactPannellum
sceneId="firstScene"
config={config}
imageSource="https://pannellum.org/images/alma.jpg"
/>
<div onClick={this.click}>Click me</div>
</div>
);
}
}
`
But here I get Error TypeError: Cannot read property 'hotspot' of undefined. How can I get reference for pannelium?
hoaiduyit commented
@vakhsakhalyan , I'm sorry for the lately reply, I will check it again and tell what the problem is.
hoaiduyit commented
hi @vakhsakhalyan , I updated newest version that fixed your problem, please update the package and check again. Thank you.
vakhsakhalyan commented
Hi, thank you very much for this quick update.
…On Wed, Dec 19, 2018 at 5:24 PM Che Hoai-Duy ***@***.***> wrote:
Closed #2 <#2>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVmzUW-eqWiO7eAkOeK384ju_uYEOHetks5u6j4YgaJpZM4YZcxL>
.