项目:基础网站,用Google的VRView for Web显示全景图,添加热点。
问题:Panorama 显示正常,无法添加热点,文档很差 + 谷歌搜索导致大约 8 天的结果很少。 1.5 小时。
代码:
<script type="text/javascript">
window.addEventListener('load', onVrViewLoad)
function onVrViewLoad() {
var vrView = new VRView.Player('#vrview', {
image: 'uploads/pano.jpg',
is_stereo: false
});
vrView.addHotspot('hotspot-one', {
pitch: 30, // In degrees. Up is positive.
yaw: 20, // In degrees. To the right is positive.
radius: 0.05, // Radius of the circular target in meters.
distance: 2, // Distance of target from camera in meters.
});
}
</script>
<div id="vrview">
</div>
请求:有没有人能够实现这些热点?我也试过点击按钮添加,但无济于事。在 laravel 服务器和基本 html 实现中都尝试过,但无济于事。
支持文档/示例:
最佳答案
你必须把你的代码添加到on ready中
<script type="text/javascript">
window.addEventListener('load', onVrViewLoad)
function onVrViewLoad() {
var vrView = new VRView.Player('#vrview', {
image: 'uploads/pano.jpg',
is_stereo: false
});
vrView.on('ready',function(){
vrView.addHotspot('hotspot-one', {
pitch: 30, // In degrees. Up is positive.
yaw: 20, // In degrees. To the right is positive.
radius: 0.05, // Radius of the circular target in meters.
distance: 2, // Distance of target from camera in meters.
});
}
});
</script>
<div id="vrview">
</div>
关于javascript - Google VRView for Web - 添加热点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42016909/