Google Street View enlarge to Fov

I need to save the Street view image exactly as selected by the user (including panoID, title, step and fov). I have the following code:

            panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'));
            panorama.addListener('pano_changed', function () {
                $('#panoID').val(panorama.getPano());
            });
            panorama.addListener('pov_changed', function () {
                $('#heading').val(panorama.getPov().heading);
                $('#pitch').val(panorama.getPov().pitch);
                $('#fov').val(panorama.getZoom());
            });

The problem is that I want to keep the scale as the fov value https://developers.google.com/maps/documentation/streetview/intro (see the optional fov parameter)

fov (default 90) defines the horizontal field of view of the image. The field of view is expressed in degrees with a maximum allowable value of 120. When working with a fixed-size viewport, like with a Street View image of a given size, the field of view is essentially a scale with smaller numbers indicating a higher level of zoom.

"" https://developers.google.com/maps/documentation/javascript/streetview#TilingPanoramas

enter image description here

, fov 180, . link , 120 . ? , , , , (.. Fov )?

, , pov_changed .

+4
2

FOV:

var k = Math.pow(0.5051, zoom);
var fov = 103.7587 * k;

( ):)

ADDED

:

var fov = 180 / Math.pow(2,zoom) 

trungk18

+6

fov :

  • fov - :

    zoom = Math.log(180/ fov )/(Math.log(2))

:

  • fov:

    fov = 180 / Math.pow(2, zoom )

0

Source: https://habr.com/ru/post/1628210/


All Articles