Google Map Type
Google MapType
##HYBRID type google map:
Google Maps - Basic Map TypesThe following map types are available in the Google Maps API:
- ##MapTypeId.ROADMAP
, used to display the default road map view
##MapTypeId.SATELLITE - , used to display Google Earth satellite images
- , used to display normal view and satellite view at the same time
- , used to display based on terrain information Actual map.
To modify the map type being used through Map, you can set the mapTypeId property for it:
var mapProp = {
center:new google .maps.LatLng(51.508742,-0.120850),};
Or dynamically modify mapTypeId:
map.setMapTypeId(google.maps.MapTypeId.HYBRID);
Google Maps The API supports special 45° images for specific locations.
These high-resolution images provide perspective views in each of the cardinal directions (southeast, northwestern). These images are also 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 images at high zoom levels, if available. If the location you zoom into has such an image, then these map types will automatically change their view in the following way:
Any existing pan controls on the map will change to Adds a compass wheel around the existing navigation control. You can use the compass to change the orientation of any 45° image by dragging the compass wheel and aligning it with the nearest supported direction containing the image.
A rotation control will be displayed in between the existing pan and zoom controls, which can be used to rotate the image around the supported directions. The rotation control only supports clockwise rotation.
A 45° perspective image centered on the current location will replace the satellite or hybrid image. By default, this type of view faces north. If you zoom out, the map reverts to the default satellite or hybrid image.
The MapType control will enable a submenu toggle control for displaying 45° images.
- NOTE: Zooming out a map type that displays a 45° image will revert all changes and rebuild the original map type.
The following example shows a 45° view of the Palazzo Ducale in Venice, Italy:
Example<html> <head> <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"> </script> <script> var myCenter=new google.maps.LatLng(45.434046,12.340284); function initialize() { var mapProp = { center:myCenter, zoom:18, mapTypeId:google.maps.MapTypeId.HYBRID }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="googleMap" style="width:500px;height:380px;"></div> </body> </html>
Tips: Google is constantly adding more cities 45° image. For the latest information, see the 45° image list on Google Maps.
Google Maps - Enabling and disabling 45° imagery - setTilt(0)
You can disable 45° imagery by calling setTilt(0) on the Map object. To enable 45° perspective images for supported map types, call setTilt(45).
Instance
<html> <head> <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"> </script> <script> var myCenter=new google.maps.LatLng(45.434046,12.340284); function initialize() { var mapProp = { center:myCenter, zoom:18, mapTypeId:google.maps.MapTypeId.HYBRID }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); map.setTilt(0); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="googleMap" style="width:500px;height:380px;"></div> </body> </html>
Run Instance»
Click the "Run Instance" button to view the online instance
Google Maps - Reference Manual
Google Maps API Reference Manual.