Replies: 1 comment 2 replies
-
Hi @stjasink, You should assign a reference like this: <Polygon
ref={(ref) => (refs.current[key] = ref)}
positions={getLinePoints()}
/> After that, you can enable editing by using: refs.current[key].enableEdit(); This way, you'll have access to the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am looking for some guidance please. The demo shows how to use the controls to create new editable layers. I need to render a number of Markers, Polylines and Polygons that I already have data for, in addition to being able to create new ones.
For example I have a few lines something like this:
How can I set these layers to be rendered as immediately editable? I don't need to do any special event handling yet. I tried simply adding an editable={true} attribute in the hope that it would work, but did not.
BTW I have some code that uses LeafletEditable in a non-React app and I set layers to be editable like this when I create them:
Any help appreciated, thanks!
Stephen
Beta Was this translation helpful? Give feedback.
All reactions