Petr Brazdil
Petr Brazdil

Reputation: 241

45 degree tilt is shown, then it's immediately switched to 0 degree view, it's happening on some locations, why?

Here is the minimal working example:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
    <script>
      var map;
      function initialize() {

        var mapOptions = {
            center: new google.maps.LatLng(37.743411, -121.93062500000002),
            tilt:45,
            zoom: 25,
            mapTypeId: google.maps.MapTypeId.SATELLITE
        };

        map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
      }

      google.maps.event.addDomListener(window, 'load', initialize);

    </script>
    </head>
    <body>
      <div id="map-canvas"></div>
    </body>
    </html>

Try refresh it and very first map is shown with correct 45 degree tilt and then it's automatically within second switched to 0 degree view. Why is this happening? Apparently 45 degree maps for this location are available so why it's not displayed correctly? Somewhere it works as expected, somewhere it's bugged like this.

Upvotes: 0

Views: 144

Answers (2)

Dr.Molle
Dr.Molle

Reputation: 117354

At the given location definitely 45° imagery is available.

The decision if these images will be used will be done by the API, as it seems by calls to the viewportService(you'll see these calls in the network-tab)

I was able to get the 45°-view even for the given location by blocking call to https://maps.googleapis.com/maps/api/js/ViewportInfoService* via ABE(of course this is not a solution).

I can't tell you why google doesn't provide the 45°-view, maybe because of copyright(when you pan the map to the right until you see the 45°-view you will notice that the copyright-notice in the bottom-right corner changes).

I'm afraid you have to take it as it is.

Upvotes: 1

kaho
kaho

Reputation: 4784

According to the list of 45° imagery on Google Maps, new google.maps.LatLng(37.743411, -121.93062500000002) isn't supported yet. However, I too, can see what is happening. It is rending the tilt image then it goes back. However, it only happens when you set heading: 0, heading with 45 and 90 seems to have the same image... so I can only say they are still preparing the 45° imagery this location.

Upvotes: 0

Related Questions