We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HI! I can't understand how to use method setPaths. I wanna update the component and change the lines.
When I try to send new props with coordinates, old coordinates also staying.
` const PolylineDecorator = withLeaflet(props => {
const { positions } = props; const polyRef = useRef();
useEffect(() => { const polyline = polyRef.current.leafletElement; //get native Leaflet polyline const { map } = polyRef.current.props.leaflet; //get native Leaflet map
L.polylineDecorator(polyline, { patterns: props.patterns, }).addTo(map);
}, [positions]); return <Polyline ref={polyRef} {...props} opacity="0" />; }); `
The text was updated successfully, but these errors were encountered:
No branches or pull requests
HI! I can't understand how to use method setPaths.
I wanna update the component and change the lines.
When I try to send new props with coordinates, old coordinates also staying.
`
const PolylineDecorator = withLeaflet(props => {
const { positions } = props;
const polyRef = useRef();
useEffect(() => {
const polyline = polyRef.current.leafletElement; //get native Leaflet polyline
const { map } = polyRef.current.props.leaflet; //get native Leaflet map
}, [positions]);
return <Polyline ref={polyRef} {...props} opacity="0" />;
});
`
The text was updated successfully, but these errors were encountered: