Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To change the orientation of a map view in the Google Maps API using JavaScript, you can use the setHeading() method of the google.maps.Map object, which sets the compass heading of the map.

For example, to set the heading of the map to 90 degrees (which corresponds to an east-facing view), you can use the following code:

map.setHeading(90);

You can also use the setTilt() method to change the tilt angle of the map view. For example, to set the tilt angle to 45 degrees, you can use the following code:

map.setTilt(45);

Note that both of these methods require that you have created a google.maps.Map object and initialized it with the appropriate options (such as the initial center and zoom level of the map).