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

Fix event listener types for Annotation and Overlay #2

Merged
merged 5 commits into from
Feb 22, 2019

Conversation

wsmd
Copy link
Owner

@wsmd wsmd commented Feb 22, 2019

Fixes #1

'deselect': EventBase<T> & { annotation: Annotation; overlay: Overlay };
'drag-start': EventBase<T> & { annotation: Annotation };
'dragging': EventBase<T> & { annotation: Annotation; coordinate: Coordinate };
'drag-end': EventBase<T> & { annotation: Annotation };
Copy link
Owner Author

@wsmd wsmd Feb 22, 2019

Choose a reason for hiding this comment

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

Those turned out to be Map events related to an Annotation, and not meant to be used on the Annotation itself.

map.addEventListner('drag-start', event => {
  event.annoation // good
});

annotation.addEventListner('drag-start', event => {
  event.annoation // bad
});

I moved those over to MapEvents and simplified the types of AnnotationEvents (now AnnotationEvent) to use EventBase only

@EricKit
Copy link
Contributor

EricKit commented Feb 22, 2019

I updated, and I have no type issues with my code. Thanks again!!

@wsmd wsmd merged commit a3d0c50 into master Feb 22, 2019
@wsmd wsmd deleted the fix-annotation-event-listener branch February 22, 2019 16:03
@wsmd wsmd changed the title Fix addEventListener type of mapkit.Annotation Fix event listener types for Annotation and Overlay Feb 22, 2019
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