leaflet-hotline-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

props mandatory default description
positions yes The positions to draw the line for. An array of [lat, lon, alt]
weight no 5 The width of the drawn line.
min no 0 The minimal number for which the color palette shall be calculated for.
max no 1 The maximal number for which the color palette shall be calculated for.
palette no { 0.0: 'green', 0.5: 'yellow', 1.0: 'red' } The color palette to distribute of the given value range.

Package Sidebar

Install

npm i leaflet-hotline-react

Weekly Downloads

61

Version

1.0.0

License

MIT

Unpacked Size

19.9 kB

Total Files

7

Last publish

Collaborators

  • lud-hu