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

Trigger an event when an annotation's coordinates change. #841

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 11, 2018

For example, layer.geoOn(geo.event.annotation.coordinates, function (evt) { console.log(evt.annotation.coordinates()); });.

Expose the annotation default edit handle style to make it possible to make global changes.

For example, `layer.geoOn(geo.event.annotation.coordinates, function
(evt) { console.log(evt.annotation.coordinates()); });`.

Expose the annotation default edit handle style to make it possible to
make global changes.
geo.event.annotation.select_edit_handle is triggered whenever an edit
handle is selected or unselected (usually by just having the mouse hover
over it).

geo.event.annotation.edit_action is triggered on actions on an edit
handle.  This includes geo.event.actionup, geo.event.actionmove, and
geo.event.actiondown.  To perform some additional processing every time
an annotation may have been changed via the edit handle, you could do
something like `layer.geoOn(geo.event.annotation.edit_action, function
(evt) { if (evt.action === geo.event.actionup) { <do something> } });`.

This also fixes a minor issue where if you drag an edit handle and then
then drag it again without the mouse leaving that handle, it would
sometimes jump slightly.
Copy link

@matthewma7 matthewma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR provided all feature that I need. And is working great. 👍

@manthey manthey merged commit 5db502d into master Jun 12, 2018
@manthey manthey deleted the annotation-coordinates-event branch June 12, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants