1.0.0 • Published 2 years ago

leaflet-hotline-react v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

leaflet-hotline-react

Ported leaflet-hotline lib to be used with react-leaflet v4 and react.

Demo image of hotline path on map

Usage

Use the Hotline component within your MapContainer.

<Hotline
  positions={[
    [47.627253, 12.434933, 1600],
    [47.628233, 12.434574, 1605],
    [47.629729, 12.433587, 1610],
    [47.631779, 12.436349, 1615],
  ]}
  weight={3}
  min={1600}
  max={1620}
  palette={{
    0.0: 'red',
    0.5: 'yellow',
    1.0: 'green',
  }}
/>

You can find a running example in example/src/main.tsx.

Props

propsmandatorydefaultdescription
positionsyesThe positions to draw the line for. An array of lat, lon, alt
weightno5The width of the drawn line.
minno0The minimal number for which the color palette shall be calculated for.
maxno1The maximal number for which the color palette shall be calculated for.
paletteno{ 0.0: 'green', 0.5: 'yellow', 1.0: 'red' }The color palette to distribute of the given value range.