gistda-sphere-react

Rectangle

Draw a rectangle on the map

<Rectangle
  position={{ lon: 100.49, lat: 13.76 }}
  size={{ width: 0.03, height: 0.02 }}
  fillColor="rgba(0, 255, 0, 0.3)"
  lineColor="green"
  lineWidth={2}
  editable
/>

Props

PropTypeRequiredDefaultDescription
positionLocationYes-Top-left corner coordinates
sizeSize | LocationYes-Size in degrees or bottom-right corner
refRef<RectangleRef>No-Ref for imperative control
titlestringNo-Hover tooltip text
detailstringNo-Popup text when clicked
popupPopupOptionsNo-Popup configuration
visibleRangeRangeNoAll zoom levelsZoom range visibility
lineWidthnumberNo3Border width in pixels
lineColorstringNoPreset colorBorder color
fillColorstringNoPreset colorFill color
lineStyle"Solid" | "Dashed" | "Dot"No"Solid"Border style
clickablebooleanNofalseShow pointer cursor
draggablebooleanNofalseAllow dragging
editablebooleanNofalseAllow corner editing
zIndexnumberNo0Stacking order
onClick(rectangle: SphereRectangle) => voidNo-Click handler
onDrag(rectangle: SphereRectangle) => voidNo-Drag handler
onDrop(rectangle: SphereRectangle) => voidNo-Drop handler

On this page