1

项目:基础网站,用谷歌VRView for Web显示全景图并添加热点。

问题:全景显示正常,无法添加热点,文档很差 + 谷歌搜索几乎没有结果。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 实现中都尝试过,但无济于事。

支持文档/示例:

4

1 回答 1

8

你必须在准备好的时候添加你的代码

<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>

于 2017-02-05T03:56:35.107 回答