Map API setMapTypeId() Method
--
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
Google Maps API Tutorial
Google API TutorialGoogle Maps APIGoogle Maps BasicsGoogle Maps OverlaysGoogle Maps EventsGoogle Maps ControlsGoogle Maps TypesGoogle Maps Reference ManualMap API Map() Constructor
Deep Dive
- Maps
- Programming
- Programming Languages
- Web Services
- Scripting Languages
- Computer Science
- Scripts
- Development Tools
- Software
- Web Services
Map API setMapTypeId() Method
Example
Change the map type to display:
map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
Definition and Usage
The setMapTypeId() method is used to change the map type to be displayed.
Syntax
mapvariable.setMapTypeId(google.maps.MapTypeId.CONSTANT);
MapTypeId Constants
map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
| Constant | Description |
|---|---|
| HYBRID | Displays a photographic map with roads and city names. |
| ROADMAP | Displays a standard, default 2D map. |
| SATELLITE | Displays a photographic map. |
| TERRAIN | Displays a map showing mountains, rivers, etc. |
YouTip