Google Maps Javascript API / Streetview FOV [英] Google Maps Javascript API / Streetview FOV

查看:99
本文介绍了Google Maps Javascript API / Streetview FOV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法改变StreetviewPanorama对象的视野?



这个地方没有记录,但Google Maps网站似乎没有与通过API创建的对象具有相同的FOV。



几个例子:



在谷歌地图上一切都看起来更加圆滑,并且API更加平坦。



两者的坐标和标题完全相同而放大并没有多大帮助。



有什么想法?

解决方案

<我有类似的问题。
您是否也使用过Firefox?



当我在Chrome上使用Google Maps API时,它与Google地图完全相同。
仍然找不到解决问题的方法。



fov应与文档中提到的相同。



https://developers.google.com/maps/documentation / javascript / streetview



所以问题就在于他们使用的投影。



我只是试图改变用户代理欺骗我使用铬的API。



$ p $ navigator .__ defineGetter __('userAgent',function(){
return'Mozilla / 5.0 Windows NT 6.1; WOW64)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 35.0.1916.153 Safari / 537.36'//定制用户代理
});

但是,当我尝试拖动全景图时,结果很慢。



也许这就是为什么他们使用大平面图像而不是3D球形图像。






2014/08/08更新



好消息解决了这个问题。

我在这里找到了一个解决方案在 Google网上论坛中。



可以在PanoramaOptions中设置一个未记录的属性mode。



您可以使用'html4','html5'和'webgl'。



如果我将模式设置为'html5',它将不会产生鱼眼效果(但tourdash使用'webgl'代替)



以下显示代码段:

  var panoramaOptions = {
pano:panoId,
pov:{
标题:标题,
音高:音高
},
启用CloseButton:false,
addressControl:false,
panControl:false,
visible:true,
clickToGo:false,
addressControl:false,
mode: html5,
zoomControlOptions:{
position:google.maps.ControlPosition.TOP_LEFT
}
};

它比仅设置用户代理好得多。


I was wondering if there was any way to change the field of view of a StreetviewPanorama object?

This is not documented anywhere but the Google Maps website does not seem to have the same FOV as the objects created via the API.

A couple of examples :

Everything looks way more spherical on Google Maps and much flatter with the API.

Both have the exact same coordinates and heading and zooming in doesn't help much.

Any ideas?

解决方案

I have a same problem like this. Did you use Firefox too?

When I'm using Google Maps API on Chrome it's totally the same as the Google Maps. Still can't find a way to solve it.

The fov should be the same as they mentioned in the documents.

https://developers.google.com/maps/documentation/javascript/streetview

So the problem will be the projection they used.

I just tried to change the user agent to cheating the API that I'm using chrome. And it works.

navigator.__defineGetter__('userAgent', function(){
    return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36' // customized user agent
});

But it turns out very slow when I try to drag the panorama.

Maybe that's why they're using a big flat image instead of a 3D spherical one.


2014/08/08 update

Good news to solve this problem.

I found a solution here in Google Groups.

There's a undocumented attribute "mode" can be set in PanoramaOptions.

You can use 'html4', 'html5' and 'webgl'.

It will be no fish-eye effect if I set the mode to 'html5'.(But tourdash use 'webgl' instead)

The following shows the code snippet:

var panoramaOptions = {
        pano : panoId,
        pov: {
          heading: heading,
          pitch: pitch
        },
        enableCloseButton:false,
        addressControl:false,
        panControl:false,
        visible: true,
        clickToGo:false,
        addressControl:false,
        mode : "html5",
        zoomControlOptions:{
            position : google.maps.ControlPosition.TOP_LEFT
        }
    };

It works way much better than just set the user agent.

这篇关于Google Maps Javascript API / Streetview FOV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆