Rectangle
<Rectangle />
component is a simplified Polygon for rectangles. for more detail, see official documentation.
Basic Example
Props
Props | Type | Description |
---|---|---|
paths | google.maps.MVCArray<google.maps.MVCArray<LatLng>> | google.maps.MVCArray<LatLng> | Array<Array<LatLng | LatLngLiteral>> | Array<LatLng | LatLngLiteral> | The ordered sequence of coordinates for drawing Rectangle. Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. |
clickable | boolean | Indicates whether this Rectangle handles mouse events. |
draggable | boolean | if flag is set to true , the user can drag Rectangle over the map. |
editable | boolean | if flag is set to true , the user can edit Rectangle by dragging the control points shown at the vertices and on each segment. |
fillColor | string | The fill color. All CSS3 colors are supported except for extended named colors. |
fillOpacity | number | The fill opacity between 0.0 and 1.0 |
geodesic | boolean | if flag is set to true , edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokePosition | google.maps.StrokePosition | The stroke position. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this polygon is visible on the map. |
zIndex | number | zIndex for Rectangle |
onClick | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for click event. Please refer to the official documentation. |
onContextmenu | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for contextmenu event. Please refer to the official documentation. |
onDblClick | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for dblclick event. Please refer to the official documentation. |
onDrag | (polygon: google.maps.Rectangle, event: google.maps.MapMouseEvent) => void; | callback for drag event. Please refer to the official documentation. |
onDragEnd | (polygon: google.maps.Rectangle, event: google.maps.MapMouseEvent) => void; | callback for dragend event. Please refer to the official documentation. |
onDragStart | (polygon: google.maps.Rectangle, event: google.maps.MapMouseEvent) => void; | callback for dragstart event. Please refer to the official documentation. |
onMouseDown | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for mousedown event. Please refer to the official documentation. |
onMouseMove | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for mousemove event. Please refer to the official documentation. |
onMouseOut | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for mouseout event. Please refer to the official documentation. |
onMouseOver | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for mouseover event. Please refer to the official documentation. |
onMouseUp | (polygon: google.maps.Rectangle, event: google.maps.PolyMouseEvent) => void; | callback for mouseup event. Please refer to the official documentation. |