Google Maps Types
Google Map of HYBRID type:
Google Maps - Basic Map Types
The following map types are provided in the Google Maps API:
MapTypeId.ROADMAP, used to display the default road map viewMapTypeId.SATELLITE, used to display Google Earth satellite imagesMapTypeId.HYBRID, used to display both normal view and satellite viewMapTypeId.TERRAIN, used to display the actual map based on terrain information.
To modify the map type being used via Map, you can set its mapTypeId property:
var mapProp = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:7,
mapTypeId: google.maps.MapTypeId.HYBRID
};
Or dynamically modify mapTypeId:
map.setMapTypeId(google.maps.MapTypeId.HYBRID);
Google Maps - 45 Degree Images
The Google Maps API supports special 45 degree images for specific locations.
Such high-resolution images can provide perspective views toward each basic direction (southeast, northwest). For supported map types, these images can also provide higher zoom levels.
The existing google.maps.MapTypeId.SATELLITE and google.maps.MapTypeId.HYBRID map types support 45 degree perspective images at high zoom levels (if available). If the location you zoom into has such images, then these map types will automatically change their view in the following way:
- **Any existing pan control on the map will be changed to add a compass wheel around the existing navigation control. You can use this compass to change the direction of any 45 degree image by: dragging the compass wheel, then aiming the direction at the nearest supported direction that contains the image.
- **A rotate control will be displayed intermittently between the existing pan and zoom controls, which can be used to rotate the image around the supported direction. The rotate control only supports clockwise rotation.
- The 45 degree perspective image centered on the current location will replace the satellite image or hybrid image. By default, such a view faces north. If you zoom out, the map will re-display the default satellite image or hybrid image.
- The MapType control will enable a submenu toggle control for displaying 45 degree images.
**Note:** Zooming out the map type that displays 45 degree images will revert all changes and rebuild the original map type.
The following example shows the 45 degree view of the Doge's Palace in Venice, Italy:
Example
var
mapProp
=
{
center
:
myCenter
,
zoom
:
18
,
mapTypeId
:
.
maps
.
MapTypeId
.
HYBRID
}
;
Try it »
**Tip:** Google is continuously adding 45 degree images for more cities. For the latest information, please refer to 45 Degree Images on Google Mapsthe list.
Google Maps - Enable and Disable 45 Degree Images - setTilt(0)
You can disable 45 degree images by calling setTilt(0) on the Map object. To enable 45 degree perspective images for supported map types, call setTilt(45).
Example
map.setTilt(0);
Try it »