Skip to content
New issue

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

finishDraw method implementation #1100

Open
clavijojuan opened this issue Feb 9, 2022 · 6 comments
Open

finishDraw method implementation #1100

clavijojuan opened this issue Feb 9, 2022 · 6 comments

Comments

@clavijojuan
Copy link

Hi,

First of all i want to say that this is a excellent plugin.

The issue is to ask if is possible add "finishDraw" method because "map.pm.disableDraw();" is stoping draw mode and removing all the "temporal layers" but i want stop and save them programmatically.

Thanks.

@Falke-Design
Copy link
Collaborator

As workaround you can call map.pm.Draw.Line._finishShape()

@clavijojuan
Copy link
Author

As workaround you can call map.pm.Draw.Line._finishShape()

Yeah, i found this in line type definition file, thanks.

Maybe should be added on README documentation. I think that is an important method.

Another think:
When you create a custom control using "map.pm.Toolbar.copyDrawControl()" with specific name and then use
map.pm.Draw[CUSTOM NAME]._finishShape()` it generates an error in typescript.

@Falke-Design
Copy link
Collaborator

Maybe should be added on README documentation

No because it is a internal private function. And because of this the TypeScript error is valid too.

I see the benefit, we will add this function in one of the next releases

@clavijojuan
Copy link
Author

No because it is a internal private function. And because of this the TypeScript error is valid too.

I see the benefit, we will add this function in one of the next releases

Ok thanks 👍

@raopengfei
Copy link

As workaround you can call map.pm.Draw.Line._finishShape()

When drawing circles and rectangles, you need the event parameter, including the latlng attribute. I do this temporarily, and other shapes can be ignored.

e.latlng = this.map.pm.Draw[shape]._hintMarker.getLatLng(); this.map.pm.Draw[shape]._finishShape(e)

@jayli3n
Copy link

jayli3n commented May 3, 2023

I see the benefit, we will add this function in one of the next releases

Hi there, just wondering if this (finishShape) made it to the release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants