gistda-sphere-react

Polyline

Draw a line connecting points on the map

<Polyline
  positions={[
    { lon: 100.4, lat: 13.72 },
    { lon: 100.5, lat: 13.8 },
    { lon: 100.6, lat: 13.72 },
  ]}
  lineColor="blue"
  lineWidth={3}
/>

Props

PropTypeRequiredDefaultDescription
positionsLocation[]Yes (min 2)-Array of points
refRef<PolylineRef>No-Ref for imperative control
titlestringNo-Hover tooltip text
detailstringNo-Popup text when clicked
labelstringNo-Label at line center
labelOptionsMarkerOptionsNo-Label marker options
popupPopupOptionsNo-Popup configuration
visibleRangeRangeNoAll zoom levelsZoom range visibility
lineWidthnumberNo3Line width in pixels
lineColorstringNoPreset colorLine color
lineStyle"Solid" | "Dashed" | "Dot"No"Solid"Line style
pivotLocationNoCenterRotation pivot
clickablebooleanNofalseShow pointer cursor
draggablebooleanNofalseAllow dragging
pointerbooleanNofalseShow drag pointer
zIndexnumberNo0Stacking order
onClick(polyline: SpherePolyline) => voidNo-Click handler
onDrag(polyline: SpherePolyline) => voidNo-Drag handler
onDrop(polyline: SpherePolyline) => voidNo-Drop handler

On this page