2

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.

Mircea Taune
  • 23
  • 1
  • 3

2 Answers2

4

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.

MrUpsidown
  • 21,592
  • 15
  • 77
  • 131
1

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.

oezi
  • 51,017
  • 10
  • 98
  • 115
  • ok i understand, i thought that if it had tilt when searching for it on google maps ( https://www.google.com/maps/@35.8218721,-82.7246444,723a,35y,39.14t/data=!3m1!1e3?hl=en-US ) it could have also on my code – Mircea Taune Jul 08 '14 at 07:20
  • Not everything that works on google maps works with the api, too. As an xample, zoom out as much ach possible on google maps and you'll see the earth as an actual sphere - sadly, you can't do this (and a lot more things) via the api (https://www.google.com/maps/@43.1500921,-95.866853,17089823m/data=!3m1!1e3?hl=en-US) – oezi Jul 08 '14 at 07:25