0

I am unable to view the rotation icon when I create a google map setting the type id to satelite as shown below.

map = new google.maps.Map(document.getElementById('map'), {
       zoom: 18,
          mapTypeId: google.maps.MapTypeId.SATELLITE,
          heading: 0
    });

Can anyone please help me with this

prashant
  • 1,382
  • 1
  • 13
  • 19
  • See the following answer : http://stackoverflow.com/questions/6800613/rotating-image-marker-image-on-google-map-v3 – O.Badr Feb 08 '17 at 09:48
  • I tried that however it rotates all the individual images in the map. I dont want that to happen. – prashant Feb 08 '17 at 10:28

1 Answers1

0

Per Google maps docs:

rotateControl enables/disables the appearance of a Rotate control for controlling the orientation of 45° imagery. By default, the control's presence is determined by the presence or absence of 45° imagery for the given map type at the current zoom and location. You may alter the control's behavior by setting the map's rotateControlOptions to specify the RotateControlOptions to use. You cannot make the control appear if no 45° imagery is currently available.

Also, rotateControl appears only if zoom is high enough. For example, this map will not show rotateControl:

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 17,
    center: {lat: -37.8136, lng: 144.9631},
     mapTypeId: google.maps.MapTypeId.SATELLITE
  });
} 

But if you zoom it a bit more, it will show rotateControl:

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 18,
    center: {lat: -37.8136, lng: 144.9631},
     mapTypeId: google.maps.MapTypeId.SATELLITE
  });
}
Ivan Jovović
  • 5,238
  • 3
  • 29
  • 57
  • I have set the map type id to google.maps.MapTypeId.SATELLITE and the zoom to 19. Yet I dont see the rotate control as I have mentioned in my example. Can you please tell me why – prashant Feb 08 '17 at 10:25
  • *You cannot make the control appear if no 45° imagery is currently available* - meaning, your code is fine, but google does not provide rotation feature on the `LatLng` that you are using. Try some large city `LatLng`, I am 99% sure it will work. – Ivan Jovović Feb 08 '17 at 10:50
  • Which are the cities where this a available. I am currently trying all big cities in India but not getting the icon... – prashant Feb 08 '17 at 11:15
  • Part of the list is here (I have not managed to find anything more up to date): https://maps.googleblog.com/2012/11/imagery-update-tour-sites-around-world.html. New York and Melbourne works for sure. Looks like India is not available yet. – Ivan Jovović Feb 08 '17 at 11:44
  • Is it possible to display the compass seen in earth view...do you have any idea about that ?? – prashant Feb 08 '17 at 11:47