Google Street View JS - FoV&FoV Event
问题描述:
我正在构建一个应用程序,使用Google街景视图API中的图片。我需要放大图像。Google Street View JS - FoV&FoV Event
我正在使用事件pov_changed
,我跟踪对POV音高和标题的更改。要决定最终图像的缩放比例,我需要一个FoV(视野)属性。
https://maps.googleapis.com/maps/api/streetview?size=700x600&location=40.159172842909,-103.201315097248&heading=22.3118227257402&pitch=-1.42049583899625&key=<key>&fov=20
我有这样的设置...
center = new google.maps.LatLng(address.latitude, address.longitude)
map = new google.maps.Map(document.getElementById('map'), {
center: center,
zoom: address.zoom
})
street = new google.maps.StreetViewPanorama(document.getElementById('street'), {
position: center,
pov: {
heading: address.pov_heading || 150,
pitch: address.pov_pitch || 0.75
}
})
要获得获取值更新形式,我有一些事情一样......但我无法找到如何获得视野属性。
street.addListener 'pov_changed', ->
pitchField.html(street.getPov().pitch)
headingField.html(street.getPov().heading)
# console.log(street.getFov()) # is not a function
# console.log(street.getFoV()) # is not a function
# console.log(street.getFOV()) # is not a function
如何查找要在链接中使用的视野以放大图像。
答
你不能得到FOV,它不是API https://developers.google.com/maps/documentation/javascript/3.exp/reference
由于anatoly.sukhanov张贴在,你可以找到计算它在这一问题的方式已经要求对SO how can I determine the Field of View a street view panorama map is using
HTTPS:/ /*.com/questions/9794436/how-can-i-determine-the-field-of-view-a-street-view-panorama-map-is-using –
@ anatoly.sukhanov:如何获得FOV是这个问题,我只需要找到FOV –