Map APIMapOptionsObject

Map() constructor

Example

Specify the attributes/options of the map:

var mapOpt = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};

Try it Yourself »

Definition and Usage

The MapOptions object holds the initialization variables/options for the map.


Syntax

var mapOpt = {
property:value,
property:value,
etc.
};


Properties of MapOptions

Attribute Type Description
backgroundColor string Specifies the background color of the Map <div>.
center LatLng Required.Specify the default map center.
disableDefaultUI boolean Enable/disable all default controls.
disableDoubleClickZoom boolean Enable/disable zoom and center on double-click.
draggable boolean When set to False, prevents the map from being dragged. Default is True.
draggableCursor string Specifies the name/URL of the cursor to display on draggable objects.
draggingCursor string Specifies the name/URL of the cursor to display when an object is being dragged.
heading number Specify the heading degrees of the aerial image.
keyboardShortcuts boolean When set to False, prevents the map from being controlled by the keyboard. Default is True.
mapMaker boolean Set to True if you want to use Map Maker tiles instead of regular tiles.
mapTypeControl boolean Specifies the default enabled/disabled state of the Map type control.
mapTypeControlOptions MapTypeControlOptions Default display options for the Map type control.
mapTypeId MapTypeId Required.Default map type.
maxZoom number Maximum zoom level of the map.
minZoom number Minimum zoom level of the map.
noClear boolean If set to True, the contents of the Map <div> will not be cleared.
overviewMapControl boolean Enabled/disabled state of the Overview Map control.
overviewMapControlOptions OverviewMapControlOptions Display options for the Overview Map control.
panControl boolean Enabled/disabled state of the Pan control.
panControlOptions PanControlOptions Display options for the Pan control.
rotateControl boolean Enabled/disabled state of the Rotate control.
rotateControlOptions RotateControlOptions Display options for the Rotate control.
scaleControl boolean Default enabled/disabled state of the Scale control.
scaleControlOptions ScaleControlOptions Default display options for the Scale control.
scrollwheel boolean When set to False, disables wheel zoom on the map. Default is True.
streetView StreetViewPanorama The StreetViewPanorama to display when the Street View pegman is dropped on the map.
streetViewControl boolean The default enabled/disabled state of the Street View Pegman control.
streetViewControlOptions StreetViewControlOptions Default display options for the Street View Pegman control.
styles Array.<MapStyleType> Styles to apply to each default map type.
tilt number The angle of incidence of the map from the viewport plane to the map plane, measured in degrees (0 and 45).
zoom number Required.Default map zoom level.
zoomControl boolean Enabled/disabled state of the Zoom control.
zoomControlOptions ZoomControlOptions Display options for the Zoom control.


Map() constructor

other extensions