react-leaflet-multi-options-polyline
v3.0.10
Published
Provides a React component to enable multiple styles for a polyline in a react-leaflet map, based on Leaflet.MultiOptionsPolyline from hgoebl(https://github.com/hgoebl/Leaflet.MultiOptionsPolyline).
Downloads
282
Maintainers
Readme
react-leaflet-multi-options-polyline
Provides a React component to enable multiple styles for a polyline in a react-leaflet map. Based on Leaflet.MultiOptionsPolyline by hgoebl.
Demos
To see demos page run on terminal:
yarn install
and then yarn start
Usage
import React from 'react';
import { MapContainer, TileLayer } from 'react-leaflet';
import ReactLeafletMultiOptionsPolyline from '../../';
export default function DataMap ({positions, optionIdxFn, options}) {
return (
<MapContainer
style={{height: '40%'}}>
<TileLayer
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"
/>
<ReactLeafletMultiOptionsPolyline
positions={positions}
optionIdxFn={optionIdxFn}
options={options}
weight={5}
lineCap='butt'
opacity={0.75}
smoothFactor={1}
zoomAnimation={false}
/>
</MapContainer>
)
}