Hi Keir. Thanks! But the correct formula apparently is logarithmic (the 
formula of the example you showed is just multiplying by 16 the value of 
zoom, which is inaccurate). I couldn't figure out how to make it, so I came 
up with a list of predefined values I got comparing images and then just 
round the value of zoom to get only the 6 possibles integers. 

Here are the values I got:

zoom=0 ----> fov=120
zoom=1 ----> fov=90
zoom=2 ----> fov=53.5
zoom=3 ----> fov=28.3
zoom=4 ----> fov=14.3
zoom=5 ----> fov=10

So, when the zoom is 0, the fov value is 120, when the zoom is 2, the fov 
value has to be 53.5, and so on.
Since the zoom value is not always an integer, I rounded the number before 
to get the value of fov. Here is the code:

var values=[120, 90, 53.5, 28.3, 14.3, 10];
var zoom=panorama.getPov().zoom;
var fov=values[Math.round(zoom)];

I generated an array with the values of fov I got comparing images, then 
get the value of zoom from the streetview window and then rounded this 
value to get the right fov.

The result of this is more approximate than your example, but it will be 
better to have to proper math formula. If some one is better than me in 
mathematics and can figure it out, please share! :-)

Thank you all
JD

 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/N3jclP06TQkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to