Options
All
  • Public
  • Public/Protected
  • All
Menu

MarkerOptions object used to define the properties that can be set on a Marker.

deprecated

As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. Please see https://developers.google.com/maps/deprecations for deprecation details.

Hierarchy

  • MarkerOptions

Index

Properties

anchorPoint?: null | google.maps.Point

The offset from the marker's position to the tip of an InfoWindow that has been opened with the marker as anchor.

animation?: null | google.maps.Animation

Which animation to play when marker is added to a map.

defaultvalue

null

clickable?: null | boolean

If true, the marker receives mouse and touch events.

defaultvalue

true

collisionBehavior?: null | string

Available only in the v=beta channel: https://goo.gle/3oAthT3. Set a collision behavior for markers on vector maps.

defaultvalue

null

deprecated

collisionBehavior is deprecated as of July 2023. Use google.maps.marker.AdvancedMarkerElement.collisionBehavior instead.

crossOnDrag?: null | boolean

If false, disables cross that appears beneath the marker when dragging.

defaultvalue

true

cursor?: null | string

Mouse cursor type to show on hover.

defaultvalue

pointer

draggable?: null | boolean

If true, the marker can be dragged.

defaultvalue

false

icon?: null | string | Icon | Symbol

Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url.

label?: null | string | MarkerLabel

Adds a label to the marker. A marker label is a letter or number that appears inside a marker. The label can either be a string, or a MarkerLabel object. If provided and google.maps.MarkerOptions.title is not provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided label's text. Please note that the label is currently only used for accessibility text for non-optimized markers.

defaultvalue

null

map?: null | Map | StreetViewPanorama

Map on which to display Marker. The map is required to display the marker and can be provided with google.maps.Marker.setMap if not provided at marker construction.

opacity?: null | number

A number between 0.0, transparent, and 1.0, opaque.

defaultvalue

1.0

optimized?: null | boolean

Optimization enhances performance by rendering many markers as a single static element. This is useful in cases where a large number of markers is required. Read more about marker optimization.

position?: null | LatLng | LatLngLiteral

Sets the marker position. A marker may be constructed but not displayed until its position is provided - for example, by a user's actions or choices. A marker position can be provided with google.maps.Marker.setPosition if not provided at marker construction.

shape?: null | MarkerShape

Image map region definition used for drag/click.

title?: null | string

Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided value. Please note that the title is currently only used for accessibility text for non-optimized markers.

defaultvalue

undefined

visible?: null | boolean

If true, the marker is visible.

defaultvalue

true

zIndex?: null | number

All markers are displayed on the map in order of their zIndex, with higher values displaying in front of markers with lower values. By default, markers are displayed according to their vertical position on screen, with lower markers appearing in front of markers further up the screen.

Generated using TypeDoc