Google Maps Type
Google Maps - Basic Map Types
The following map types are available in the Google Maps API:
1.MapTypeId.ROADMAP, used to display the default road map view
2.MapTypeId.SATELLITE, used to display Google Earth satellite images
3.MapTypeId.HYBRID, used to display both normal and satellite views
4.MapTypeId.TERRAIN, used to display the actual map based on terrain information.
To modify the map type being used via Map, you can set the mapTypeId property for it:
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° Image
The Google Maps API supports special 45° images for specific locations.
Such high-resolution images provide perspective views towards each basic direction (southeast, northwest and north). For supported map types, these images also offer higher zoom levels.
The existing google.maps.MapTypeId.SATELLITE and google.maps.MapTypeId.HYBRID map types support high zoom levels of 45° perspective images (if any). If you have such images at the location where you zoom in, these map types will automatically change their views by:
1. Any existing pan controls on the map will be changed to add a compass rotor around the existing navigation controls. You can change the orientation of any 45° image through this compass by dragging the compass wheel and then pointing the orientation to the nearest supported direction containing the image.
2. A rotating control displays the gap between the existing translation and zoom controls, which can be used to rotate the image around the supported direction. The rotation control only supports clockwise rotation.
3. A 45° perspective image centered on the current position will replace satellite image or mixed image. By default, such views will face north. If you zoom out, the map redisplays the default satellite or mixed images.
4. The MapType control will enable the submenu toggle control to display 45° images.
Note: Reducing the map type that displays 45° images will restore all changes and rebuild the original map type.
The following example shows a 45° view of the Duke of Venice, Italy:
Example
<html><head><scriptsrc="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"></div></body></html>Tip: Google is constantly adding 45° images to more cities. For the latest information, see the 45° image list on Google Maps.
Google Maps - Enable and disable 45° Images - setTilt(0)
You can deactivate a 45° image by calling setTilt(0) on the Map object. To enable a 45° perspective image for supported map types, call setTilt(45).
Example
<html><head><scriptsrc="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"></div></body></html>The above is a brief compilation and explanation of Google Maps type information. I hope that friends who can help develop Google Maps will continue to add relevant knowledge in the future. Thank you for your support for this site!