如何自动更改谷歌街景的旋转角度?
我正在使用谷歌街景,我想让用户在进入我的网站时环顾街道。
我已经尝试过:
var lookAround = function(){
pano.getPov().heading = pano.getPov().heading + 50;
if(pano.getPov().heading < 100){
setTimeout("lookAround()",2000);
}
};
但它不起作用,旋转参数实际上已经改变,但图片的视图没有改变。
任何人都可以帮我解决这个问题吗?非常感谢!
I'm using google street view , i want to make users look around the street when they enter my site.
I have tried this:
var lookAround = function(){
pano.getPov().heading = pano.getPov().heading + 50;
if(pano.getPov().heading < 100){
setTimeout("lookAround()",2000);
}
};
but it doesn't work , the rotation parameter have actually changed , but the view of the picture doesn't.
Can any one help me with this ?many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您对全景图进行任何更改时,您必须使用 setVisible 方法使其可见。在您的情况下,您必须在设置新标题后调用 pano.setVisible(true) 。
When you make any changes to the panorama you have to make it visible by using the method setVisible. In your case you have to call pano.setVisible(true) after you set the new heading.