Skip to content

Marker

<Marker /> component is used for display Marker.

Basic Example

function MyMap() {
return (
<GoogleMap
center={{ lat: 37.5111158, lng: 127.098167 }}
{...}
>
<Marker lat={37.5111158} lng={127.098167} title='Lotte World' />
{/* draggable */}
<Marker lat={37.5111158} lng={127.096167} title={'I\'m draggable'} draggable />
</GoogleMap>
);
}

Props

PropsTypeDescription
latnumberlatitude
lngnumberlongitude
draggablebooleanflag for draggable feature
anchorPointgoogle.maps.PointPlease refer to the official documentation.
animationgoogle.maps.Animation
clickableboolean
collisionBehaviorstring
crossOnDragboolean
cursorstring
draggableboolean
iconstring | google.maps.Icon | google.maps.Symbol
labelstring | google.maps.MarkerLabel
opacitynumber
optimizedboolean
shapegoogle.maps.MarkerShape
titlestring
visibleboolean
zIndexnumber
onAnimationChanged(marker: google.maps.Marker) => voidcallback for animation_changed event. Please refer to the official documentation.
onClick(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for click event. Please refer to the official documentation.
onClickableChanged(marker: google.maps.Marker) => voidcallback for clickable_changed event. Please refer to the official documentation.
onContextMenu(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for contextmenu event. Please refer to the official documentation.
onCursorChanged(marker: google.maps.Marker) => voidcallback for cursor_changed event. Please refer to the official documentation.
onDblClick(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for dblclick event. Please refer to the official documentation.
onDrag(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for drag event. Please refer to the official documentation.
onDragEnd(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for dragend event. Please refer to the official documentation.
onDraggableChanged(marker: google.maps.Marker) => voidcallback for draggable_changed event. Please refer to the official documentation.
onDragStart(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for dragstart event. Please refer to the official documentation.
onFlatChanged(marker: google.maps.Marker) => voidcallback for flat_changed event. Please refer to the official documentation.
onIconChanged(marker: google.maps.Marker) => voidcallback for icon_changed event. Please refer to the official documentation.
onMouseDown(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for mousedown event. Please refer to the official documentation.
onMouseOut(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for mouseout event. Please refer to the official documentation.
onMouseOver(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for mouseover event. Please refer to the official documentation.
onMouseUp(marker: google.maps.Marker, event: google.maps.MapMouseEvent) => voidcallback for mouseup event. Please refer to the official documentation.
onPositionChanged(marker: google.maps.Marker) => voidcallback for position_changed event. Please refer to the official documentation.
onShapeChanged(marker: google.maps.Marker) => voidcallback for shape_changed event. Please refer to the official documentation.
onTitleChanged(marker: google.maps.Marker) => voidcallback for title_changed event. Please refer to the official documentation.
onVisibleChanged(marker: google.maps.Marker) => voidcallback for visible_changed event. Please refer to the official documentation.
onZindexChanged(marker: google.maps.Marker) => voidcallback for zindex_changed event. Please refer to the official documentation.

Render custom HTML Marker

Please refer to CustomMarker page.

Conenct to the InfoWindow

Please refer to InfoWindow page.

Marker Clustering

Please refer to MarkerClusterer page.