how can I determine the Field of View a street view panorama map is using

后端 未结 5 1362
余生分开走
余生分开走 2021-01-05 01:23

I notice the Field of View (FOV) degree per street view zoom level is different between browsers

I believe the documented street view zoom level to FOV is



        
相关标签:
5条回答
  • 2021-01-05 01:27

    Since this seems to be the first result on google, for anyone interested, you can use the formula

    Math.atan(Math.pow(2, 1 - zoom)) * 360 / Math.PI
    

    to get the zoom levels

    0: 127, 1: 90, 2: 53, 3: 28, 4: 14
    

    I couldn't find this anywhere in the documentation, but it fits the data perfectly and looks like the math for a cylindrical projection.

    0 讨论(0)
  • 2021-01-05 01:31

    It is not direct answer to a question, but maybe it helps:

    There is undocumented option of google.maps.StreetViewPanorama class named 'mode'. You will be able to force rendering mode, and FOV should be the same for eg. 'html5'

    Google Maps API custom Street View quality issue

    0 讨论(0)
  • 2021-01-05 01:33

    I can't find the solution other than to use 90 degree FOV which is consistent at zoom 1 for all browsers that I have tested

    0 讨论(0)
  • 2021-01-05 01:36

    Currently, there is a table here relating zoom and FOV that says:

    0=>180 1=>90 2=>45 3=>22.5 4=>11.5

    You can convert from zoom to FOV in javascript like this:

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

    0 讨论(0)
  • 2021-01-05 01:38

    the issue is with when the maps api supports the use of CANVAS with the specific browser

    Maps API version 3.7 January 24, 2012 included Enabled Canvas Street View on IE 9, Opera and Safari/Windows

    using maps api 3.6 that doesn't support canvas in maps ( except chrome browser ) you get the FOV as 0: 180, 1: 90, 2: 45, 3: 22.5, 4: 11:25

    any streetview loaded within a maps supported canvas get FOV as 0: 127, 1: 90, 2: 53, 3: 28, 4: 14

    0 讨论(0)
提交回复
热议问题