InfoWindow
<InfoWindow />
component is used for display content (usually text or images) in a popup window above the map, at a given location. for more detail, see official google map documentation.
Basic Example
Props
Props | Type | Description |
---|---|---|
open | boolean | InfoWindow open flag. if flag is set to true , InfoWindow will be displayed on the map. |
shouldFocus | boolean | Whether or not focus should be moved inside the InfoWindow when it is opened. |
ariaLabel | string | AriaLabel to assign to the InfoWindow. |
content | ReactElement<unknown> | string | Element | Text | Content to display in the InfoWindow. |
disableAutoPan | boolean | Disable panning the map to make the InfoWindow fully visible when it opens. |
maxWidth | number | Maximum width of the InfoWindow |
minWidth | number | Minimum width of the InfoWindow |
pixelOffset | google.maps.Size | The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored. |
position | google.maps.LatLng | google.maps.LatLngLiteral | The LatLng at which to display this InfoWindow. If the InfoWindow is opened with Marker children(anchor), the anchor’s position will be used instead. |
zIndex | number | zIndex for InfoWindow. |
onCloseClick | (infoWindow: google.maps.InfoWindow) => void | callback for closeclick event. Please refer to the official documentation. |
onContentChanged | (infoWindow: google.maps.InfoWindow) => void | callback for content_changed event. Please refer to the official documentation. |
onDomReady | (infoWindow: google.maps.InfoWindow) => void | callback for domready event. Please refer to the official documentation. |
onPositionChanged | (infoWindow: google.maps.InfoWindow) => void | callback for position_changed event. Please refer to the official documentation. |
onVisible | (infoWindow: google.maps.InfoWindow) => void | callback for visible event. Please refer to the official documentation. |
onZIndexChanged | (infoWindow: google.maps.InfoWindow) => void | callback for zindex_changed event. Please refer to the official documentation. |
Anchor
If you pass Marker or AdvancedMarker to children, it will be used as an anchor.
The anchor to which this InfoWindow will be positioned. If the anchor is non-null, the InfoWindow will be positioned at the top-center of the anchor. The InfoWindow will be rendered on the same map or panorama as the anchor (when available).
otherwise you can