Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Google Maps Types


Google Maps - Basic Map Types

The following map types are supported in Google Maps API:

  • ROADMAP (normal, default 2D map)
  • SATELLITE (photographic map)
  • HYBRID (photographic map + roads and city names)
  • TERRAIN (map with mountains, rivers, etc.)

The map type is specified either within the Map properties object, with the mapTypeId property:

var mapOptions = {
  center:new google.maps.LatLng(51.508742,-0.120850),
  zoom:7,
  mapTypeId: google.maps.MapTypeId.HYBRID
};

Or by calling the map's setMapTypeId() method:

map.setMapTypeId(google.maps.MapTypeId.HYBRID);


Google Maps - 45° Perspective View

The map types SATELLITE and HYBRID support a 45° perspective imagery view for certain locations (only at high zoom levels).

If you zoom into a location with 45° imagery view, the map will automatically alter the perspective view. In addition, the map will add:

  • A compass wheel around the Pan control, allowing you to rotate the image
  • A Rotate control between the Pan and Zoom controls, allowing you to rotate the image 90°
  • A toggle control for displaying the 45° perspective view, under the Satellite control/label

Note: Zooming out from a map with 45° imagery will revert each of these changes, and the original map is displayed.

The following example shows a 45° perspective view of Palazzo Ducale in Venice, Italy:

Example

var mapOptions = {
  center:myCenter,
  zoom:18,
  mapTypeId:google.maps.MapTypeId.HYBRID
};

Google Maps - Disable 45° Perspective View - setTilt(0)

You can disable 45° perspective view by calling setTilt(0) on the Map object:

Example

map.setTilt(0);

Tip: To enable 45° perspective view at a later point, call setTilt(45).


W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.