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
I've been wondering how I can start the drawing as soon as I display the map. I have a field that expands to reveal the map. So my solution was this:
useEffect(() => { const target = document.querySelector(".leaflet-draw-draw-polygon") if (active && target) { target.dispatchEvent(new Event("click")) } }, [active])
active is a prop that I pass from the parent component and it's a boolean.
I'm curious who else might have some feedback. Thanks in advance
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've been wondering how I can start the drawing as soon as I display the map. I have a field that expands to reveal the map. So my solution was this:
active is a prop that I pass from the parent component and it's a boolean.
I'm curious who else might have some feedback. Thanks in advance
The text was updated successfully, but these errors were encountered: