Options
All
  • Public
  • Public/Protected
  • All
Menu

MapOptions object used to define the properties that can be set on a Map.

Hierarchy

Index

Properties

Optional backgroundColor

backgroundColor?: null | string

Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans. This option can only be set when the map is initialized.

Optional center

center?: null | LatLng | LatLngLiteral

The initial Map center.

Optional clickableIcons

clickableIcons?: null | boolean

When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI.

defaultvalue

true

Optional controlSize

controlSize?: null | number

Size in pixels of the controls appearing on the map. This value must be supplied directly when creating the Map, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls.

Optional disableDefaultUI

disableDefaultUI?: null | boolean

Enables/disables all default UI buttons. May be overridden individually. Does not disable the keyboard controls, which are separately controlled by the google.maps.MapOptions.keyboardShortcuts option. Does not disable gesture controls, which are separately controlled by the google.maps.MapOptions.gestureHandling option.

Optional disableDoubleClickZoom

disableDoubleClickZoom?: null | boolean

Enables/disables zoom and center on double click. Enabled by default.

Note: This property is not recommended. To disable zooming on double click, you can use the gestureHandling property, and set it to "none".

Optional draggable

draggable?: null | boolean

If false, prevents the map from being dragged. Dragging is enabled by default.

deprecated

Deprecated in 2017. To disable dragging on the map, you can use the gestureHandling property, and set it to "none".

Optional draggableCursor

draggableCursor?: null | string

The name or url of the cursor to display when mousing over a draggable map. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggableCursor: 'url(http://www.example.com/icon.png), auto;'.

Optional draggingCursor

draggingCursor?: null | string

The name or url of the cursor to display when the map is being dragged. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: draggingCursor: 'url(http://www.example.com/icon.png), auto;'.

Optional fullscreenControl

fullscreenControl?: null | boolean

The enabled/disabled state of the Fullscreen control.

Optional fullscreenControlOptions

fullscreenControlOptions?: null | FullscreenControlOptions

The display options for the Fullscreen control.

Optional gestureHandling

gestureHandling?: null | string

This setting controls how the API handles gestures on the map. Allowed values:

  • "cooperative": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map.
    In this mode the map cooperates with the page.
  • "greedy": All touch gestures and scroll events pan or zoom the map.
  • "none": The map cannot be panned or zoomed by user gestures.
  • "auto": (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or in an iframe.

Optional heading

heading?: null | number

The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available.

Optional isFractionalZoomEnabled

isFractionalZoomEnabled?: null | boolean

Whether the map should allow fractional zoom levels. Listen to isfractionalzoomenabled_changed to know when the default has been set.

defaultvalue

true for vector maps and false for raster maps

Optional keyboardShortcuts

keyboardShortcuts?: null | boolean

If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default.

Optional mapId

mapId?: null | string

The Map ID of the map. This parameter cannot be set or changed after a map is instantiated.

Optional mapTypeControl

mapTypeControl?: null | boolean

The initial enabled/disabled state of the Map type control.

Optional mapTypeControlOptions

mapTypeControlOptions?: null | MapTypeControlOptions

The initial display options for the Map type control.

Optional mapTypeId

mapTypeId?: null | string

The initial Map mapTypeId. Defaults to ROADMAP.

Optional maxZoom

maxZoom?: null | number

The maximum zoom level which will be displayed on the map. If omitted, or set to null, the maximum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level.

Optional minZoom

minZoom?: null | number

The minimum zoom level which will be displayed on the map. If omitted, or set to null, the minimum zoom from the current map type is used instead. Valid zoom values are numbers from zero up to the supported maximum zoom level.

Optional noClear

noClear?: null | boolean

If true, do not clear the contents of the Map div.

Optional panControl

panControl?: null | boolean

The enabled/disabled state of the Pan control.

Note: The Pan control is not available in the new set of controls introduced in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you can choose to use the earlier set of controls rather than the new controls, thus making the Pan control available as part of the old control set. See What's New in the v3.22 Map Controls.

Optional panControlOptions

panControlOptions?: null | PanControlOptions

The display options for the Pan control.

Note: The Pan control is not available in the new set of controls introduced in v3.22 of the Google Maps JavaScript API. While using v3.22 and v3.23, you can choose to use the earlier set of controls rather than the new controls, thus making the Pan control available as part of the old control set. See What's New in the v3.22 Map Controls.

Optional restriction

restriction?: null | MapRestriction

Defines a boundary that restricts the area of the map accessible to users. When set, a user can only pan and zoom while the camera view stays inside the limits of the boundary.

Optional rotateControl

rotateControl?: null | boolean

The enabled/disabled state of the Rotate control.

Optional rotateControlOptions

rotateControlOptions?: null | RotateControlOptions

The display options for the Rotate control.

Optional scaleControl

scaleControl?: null | boolean

The initial enabled/disabled state of the Scale control.

Optional scaleControlOptions

scaleControlOptions?: null | ScaleControlOptions

The initial display options for the Scale control.

Optional scrollwheel

scrollwheel?: null | boolean

If false, disables zooming on the map using a mouse scroll wheel. The scrollwheel is enabled by default.

Note: This property is not recommended. To disable zooming using scrollwheel, you can use the gestureHandling property, and set it to either "cooperative" or "none".

Optional streetView

streetView?: null | StreetViewPanorama

A StreetViewPanorama to display when the Street View pegman is dropped on the map. If no panorama is specified, a default StreetViewPanorama will be displayed in the map's div when the pegman is dropped.

Optional streetViewControl

streetViewControl?: null | boolean

The initial enabled/disabled state of the Street View Pegman control. This control is part of the default UI, and should be set to false when displaying a map type on which the Street View road overlay should not appear (e.g. a non-Earth map type).

Optional streetViewControlOptions

streetViewControlOptions?: null | StreetViewControlOptions

The initial display options for the Street View Pegman control.

Optional styles

styles?: null | MapTypeStyle[]

Styles to apply to each of the default map types. Note that for satellite/hybrid and terrain modes, these styles will only apply to labels and geometry.

Optional tilt

tilt?: null | number

For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map. For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value specified by this option. Because getTilt and this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects.

Optional zoom

zoom?: null | number

The initial Map zoom level. Valid zoom values are numbers from zero up to the supported maximum zoom level. Larger zoom values correspond to a higher resolution.

Optional zoomControl

zoomControl?: null | boolean

The enabled/disabled state of the Zoom control.

Optional zoomControlOptions

zoomControlOptions?: null | ZoomControlOptions

The display options for the Zoom control.

Generated using TypeDoc