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

Drawend event #85

Closed
oiacrasec opened this issue Nov 24, 2018 · 3 comments
Closed

Drawend event #85

oiacrasec opened this issue Nov 24, 2018 · 3 comments
Assignees
Labels

Comments

@oiacrasec
Copy link

Hello! How can i use the drawend event with ole2?

My code:

var draw;
if (tipo === 'Point') {
draw = new ole.control.Draw({
source: source
});
} else if (tipo === 'LineString') {
draw = new ole.control.Draw({
type: 'LineString',
source: source
});
} else if (tipo === 'Polygon') {
draw = new ole.control.Draw({
type: 'Polygon',
source: source
});
}

draw.on('drawend', function (evt) {
...

            });
@friedjoff
Copy link
Member

@oiacrasec You can attach an event handler to draw.drawInteraction like this:

var draw = new ole.control.Draw()
draw.drawInteraction.on('drawend', function(evt) { ... }

Please note that draw.drawInteraction is not a public API right now, so it could change in future releases without notice.

@mhaertwig What do you think about making drawInteraction an public property and maybe renaming it to interaction?

@oiacrasec
Copy link
Author

@friedjoff thank you, it works perfectly

@mhaertwig
Copy link
Contributor

@mhaertwig What do you think about making drawInteraction an public property and maybe renaming it to interaction?

Sounds good! How do we deal with controls having multiple interactions, like the CAD control. Alternatively we could implement a custom event handling for OLE to be more flexible. What do you think?

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

No branches or pull requests

4 participants