google.maps.Marker class
This class extends MVCObject.
Constructor
Marker([opts])
Parameters:
- opts: MarkerOptions optional
Creates a marker with the options specified. If a map is specified, the marker is added to the map upon construction. Note that the position must be set for the marker to display.
Methods
getAnimation()
Parameters: None
Return Value: Animation optional
getClickable()
Parameters: None
Return Value: boolean
getCursor()
Parameters: None
Return Value: string
getDraggable()
Parameters: None
Return Value: boolean
getIcon()
Parameters: None
Return Value: string|Icon|Symbol
getLabel()
Parameters: None
Return Value: MarkerLabel
getMap()
Parameters: None
Return Value: Map|StreetViewPanorama
getOpacity()
Parameters: None
Return Value: number
getPosition()
Parameters: None
Return Value: LatLng
getShape()
Parameters: None
Return Value: MarkerShape
getTitle()
Parameters: None
Return Value: string
getVisible()
Parameters: None
Return Value: boolean
getZIndex()
Parameters: None
Return Value: number
setAnimation(animation)
Parameters:
- animation: Animation optional
Return Value: None
Start an animation. Any ongoing animation will be cancelled. Currently supported animations are: BOUNCE, DROP. Passing in null will cause any animation to stop.
setClickable(flag)
Parameters:
- flag: boolean
Return Value: None
setCursor(cursor)
Parameters:
- cursor: string
Return Value: None
setDraggable(flag)
Parameters:
- flag: boolean optional
Return Value: None
setIcon(icon)
Parameters:
Return Value: None
setLabel(label)
Parameters:
- label: string|MarkerLabel
Return Value: None
setMap(map)
Parameters:
- map: Map|StreetViewPanorama
Return Value: None
Renders the marker on the specified map or panorama. If map is set to null, the marker will be removed.
setOpacity(opacity)
Parameters:
- opacity: number
Return Value: None
setOptions(options)
Parameters:
- options: MarkerOptions
Return Value: None
setPosition(latlng)
Parameters:
- latlng: LatLng|LatLngLiteral
Return Value: None
setShape(shape)
Parameters:
- shape: MarkerShape
Return Value: None
setTitle(title)
Parameters:
- title: string
Return Value: None
setVisible(visible)
Parameters:
- visible: boolean
Return Value: None
setZIndex(zIndex)
Parameters:
- zIndex: number
Return Value: None
Constants
The maximum default z-index that the API will assign to a marker. You may set a higher z-index to bring a marker to the front.
Events
function()
Arguments: None
This event is fired when the marker's animation property changes.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the marker icon was clicked.
function()
Arguments: None
This event is fired when the marker's clickable property changes.
function()
Arguments: None
This event is fired when the marker's cursor property changes.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the marker icon was double clicked.
function(event)
Arguments:
- event: MouseEvent
This event is repeatedly fired while the user drags the marker.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the user stops dragging the marker.
function()
Arguments: None
This event is fired when the marker's draggable property changes.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the user starts dragging the marker.
function()
Arguments: None
This event is fired when the marker's flat property changes.
function()
Arguments: None
This event is fired when the marker icon property changes.
function(event)
Arguments:
- event: MouseEvent
This event is fired for a mousedown on the marker.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the mouse leaves the area of the marker icon.
function(event)
Arguments:
- event: MouseEvent
This event is fired when the mouse enters the area of the marker icon.
function(event)
Arguments:
- event: MouseEvent
This event is fired for a mouseup on the marker.
function()
Arguments: None
This event is fired when the marker position property changes.
function(event)
Arguments:
- event: MouseEvent
This event is fired for a rightclick on the marker.
function()
Arguments: None
This event is fired when the marker's shape property changes.
function()
Arguments: None
This event is fired when the marker title property changes.
function()
Arguments: None
This event is fired when the marker's visible property changes.
function()
Arguments: None
This event is fired when the marker's zIndex property changes.