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

Consistent meaning of annotation events across annotation types #623

Closed
kotfic opened this issue Oct 3, 2016 · 4 comments
Closed

Consistent meaning of annotation events across annotation types #623

kotfic opened this issue Oct 3, 2016 · 4 comments
Assignees

Comments

@kotfic
Copy link

kotfic commented Oct 3, 2016

This code path leads to inconsistent behavior for rectangle and point/polygon geo.event.annotation.add and geo.event.annotation.state events. Point and polygon objects will trigger an add on layer.mode(...) before any coordinates have been set. This information only becomes available for points and polygons in the state event. Rectangles on the other hand provide coordinate information in the add event, and do not fire the state event at all.

@aashish24
Copy link
Member

@manthey thoughts?

@manthey
Copy link
Contributor

manthey commented Oct 20, 2016

I see @kotfic's point, but I'm not completely convinced things should be changed. Our choice is:

  • Make it so any time you set the annotation layer mode a new annotation is created in the create state. This requires all annotations to have a create state. It is a pretty easy change, and unifies some of the behavior, but it isn't a technical necessity.
  • Leave things as they are. Some annotations have a create step and some don't. Those with a create step issue a state change when then switch from create to done. Those without a create step issue an add event when they are instantiated (and start in the done state).
  • We could even change the point annotation so it doesn't have a create step, as it isn't required.

I'm leaning toward making all annotations have a create state.

@kotfic
Copy link
Author

kotfic commented Oct 20, 2016

@manthey this is your barbecue. I will say, as a user of the API, I am actually less interested in the state of the annotation per-say and more interested in getting consistent events that I can hook into. I am especially interested in events that allow me to dynamically modify annotations attributes before the annotation is actually rendered.

@manthey
Copy link
Contributor

manthey commented Nov 10, 2016

Resolved in PR #643. Ping @kotfic.

@manthey manthey closed this as completed Nov 10, 2016
danlamanna added a commit to OpenGeoscience/geonotebook that referenced this issue Dec 12, 2016
OpenGeoscience/geojs#623 was resolved and #51
implicitly upgraded our version to incorporate the new interface. As a
result, trying to make a rectangle annotation threw a
"JSONRPCError (-32000): list index out of range".
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

No branches or pull requests

3 participants