Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Maps API setMapTypeId() Method

Maps API setMapTypeId() Method

Map() Constructor Map() Constructor

Example

Change the map type to display:

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

Try it »


Definition and Usage

The setMapTypeId() method is used to change the map type to display.


Syntax

mapvariable

.setMapTypeId(google.maps.MapTypeId.

CONSTANT

);


Constants of MapTypeId

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 with mountains, rivers, etc.

Map() Constructor Map() Constructor