Maps API MapOptions Object
Example
Specifies the properties/options of the map:
var mapOpt = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
Try it »
Definition and Usage
The MapOptions object holds the initialization variables/options of the map.
Syntax
var mapOpt = {
property
:
value
,
property
:
value
,
etc.
};
Properties of MapOptions
| property | Type | Description |
|---|---|---|
| backgroundColor | string | Specifies the map
background color. |
| center | LatLng | **Required.** Specifies 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 the object is being dragged. |
| heading | number | Specifies the heading in 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 | The default display options of 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 | When set to True, does not clear the Map
. |
| overviewMapControl | boolean | Enable/disable state of the Overview Map control. |
| overviewMapControlOptions | OverviewMapControlOptions | Display options of the Overview Map control. |
| panControl | boolean | Enable/disable state of the Pan control. |
| panControlOptions | PanControlOptions | Display options of the Pan control. |
| rotateControl | boolean | Enable/disable state of the Rotate control. |
| rotateControlOptions | RotateControlOptions | Display options of the Rotate control. |
| scaleControl | boolean | Default enable/disable state of the Scale control. |
| scaleControlOptions | ScaleControlOptions | Default display options of the Scale control. |
| scrollwheel | boolean | When set to False, disables scroll-wheel zoom on the map. Default is True. |
| streetView | StreetViewPanorama | The StreetViewPanorama to display when the Street View pegman icon on the map is dropped. |
| streetViewControl | boolean | Default enable/disable state of the Street View Pegman control. |
| streetViewControlOptions | StreetViewControlOptions | Default display options of the Street View Pegman control. |
| styles | Array. |
Styles to apply to each default map type. |
| tilt | number | The incidence angle from the viewport plane to the map plane, measured in degrees (0 and 45). |
| zoom | number | **Required.** Default Map zoom level. |
| zoomControl | boolean | Enable/disable state of the Zoom control. |
| zoomControlOptions | ZoomControlOptions | Display options of the Zoom control. |
Map() Constructor