From 8abefa003fa5b0386a089f7adca026737d995f67 Mon Sep 17 00:00:00 2001 From: Sergej Grilborzer Date: Wed, 4 Jul 2018 22:30:49 +0200 Subject: [PATCH] feat(AgmMarker): add rightclick support (#1443) closes #1362 --- packages/core/directives/marker.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/directives/marker.ts b/packages/core/directives/marker.ts index e4ccd8f8e..741d6ee5e 100644 --- a/packages/core/directives/marker.ts +++ b/packages/core/directives/marker.ts @@ -115,6 +115,11 @@ export class AgmMarker implements OnDestroy, OnChanges, AfterContentInit { */ @Output() markerClick: EventEmitter = new EventEmitter(); + /** + * This event is fired when the user rightclicks on the marker. + */ + @Output() markerRightClick: EventEmitter = new EventEmitter(); + /** * This event is fired when the user stops dragging the marker. */ @@ -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('dragend', this) .subscribe((e: mapTypes.MouseEvent) => {