Skip to content

Commit

Permalink
feat(AgmMarker): add rightclick support (#1443)
Browse files Browse the repository at this point in the history
closes #1362
  • Loading branch information
s-gbz authored and sebholstein committed Jul 4, 2018
1 parent 34b7918 commit 8abefa0
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 8abefa0

Please sign in to comment.