如何自动更改谷歌街景的旋转角度?

发布于 2024-12-21 16:05:20 字数 305 浏览 3 评论 0原文

我正在使用谷歌街景,我想让用户在进入我的网站时环顾街道。

我已经尝试过:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿! 2024-12-28 16:05:20

当您对全景图进行任何更改时,您必须使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文