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

feat: add rightclick event to marker #1443

Merged
merged 3 commits into from
Jul 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/core/directives/marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit {
*/
@Output() markerClick: EventEmitter<void> = new EventEmitter<void>();

/**
* This event is fired when the user rightclicks on the marker.
*/
@Output() markerRightClick: EventEmitter<void> = new EventEmitter<void>();

/**
* This event is fired when the user stops dragging the marker.
*/
Expand Down Expand Up @@ -214,6 +219,11 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit {
});
this._observableSubscriptions.push(cs);

const rc = this._markerManager.createEventObservable('rightclick', this).subscribe(() => {
this.markerRightClick.emit(null);
});
this._observableSubscriptions.push(rc);

const ds =
this._markerManager.createEventObservable<mapTypes.MouseEvent>('dragend', this)
.subscribe((e: mapTypes.MouseEvent) => {
Expand Down