Mircea Taune
Mircea Taune

Reputation: 33

Google Map Tilt not working

I am developing a site with some parcels ( layers on google map ) and the client wants the map to be in tilt view. I understand the google api but i don't know why my tilt setting and heading are not taken into consideration.

This is my code creating the map:

map = new google.maps.Map(document.getElementById('map-canvas'), {
    zoom: 18,
    center: new google.maps.LatLng(35.8313284, -82.7251666),
    mapTypeId: google.maps.MapTypeId.SATELLITE,
    heading: 90,
    tilt: 45
});

I see the working examples but i can't get mine to work. here you can see it live http://sigmalogic.eu/mapdwr/index.html.

I just want to know why the tilt is not working, or heading is good at first but it rotates.

Upvotes: 3

Views: 5373

Answers (2)

MrUpsidown
MrUpsidown

Reputation: 22495

If you want to avoid getting errors when asking for 45° imagery, you can first test if imagery is available:

if (map.getTilt()) {

    map.setTilt(45);
}

JSFiddle demo

Hope this helps.

Upvotes: 4

oezi
oezi

Reputation: 51817

Google doesn't have 45°-Images everywhere. The Documentation states:

45° Imagery

The Google Maps API supports special 45° imagery for certain locations. This high-resolution imagery provides perspective views towards each of the cardinal direction (North, South, East, West). These images are available at higher zoom levels for supported map types.

[...]

The existing google.maps.MapTypeId.SATELLITE and google.maps.MapTypeId.HYBRID map types support 45° perspective imagery at high zoom levels (where available).

You can see the currently available locations on this map.

Upvotes: 2

Related Questions