Angular-google-maps: adding dragEnd event to agm

Created on 3 Oct 2017  ·  3Comments  ·  Source: SebastianM/angular-google-maps

hello all,
i add the event follow this example https://github.com/SebastianM/angular-google-maps/pull/1159/files
but still the change did not show up. how can i rebuild the project that the changes will included?

stale

Most helpful comment

@matishw you can clone the repo from my profile and use npm/yarn to build it, although I suggest you to wait for this PR to be merged. in the meanwhile, you can use this workaround:

@ViewChild(AgmMap) map: any;
private dragEndSubscription: Subscription;

ngOnInit() {
  this.dragEndSubscription = (this.map._mapsWrapper as GoogleMapsAPIWrapper) 
    .subscribeToMapEvent('dragend')
    .subscribe(() => // Your logic goes here);
}

ngOnDestroy() {
  this.dragEndSubscription.unsubscribe();
}

All 3 comments

@matishw did you figure it out? I'm about to add more events to markers as well, so I'm interested in this.

@matishw you can clone the repo from my profile and use npm/yarn to build it, although I suggest you to wait for this PR to be merged. in the meanwhile, you can use this workaround:

@ViewChild(AgmMap) map: any;
private dragEndSubscription: Subscription;

ngOnInit() {
  this.dragEndSubscription = (this.map._mapsWrapper as GoogleMapsAPIWrapper) 
    .subscribeToMapEvent('dragend')
    .subscribe(() => // Your logic goes here);
}

ngOnDestroy() {
  this.dragEndSubscription.unsubscribe();
}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mensch picture mensch  ·  3Comments

n1t3w0lf picture n1t3w0lf  ·  3Comments

shedar picture shedar  ·  4Comments

Halynsky picture Halynsky  ·  3Comments

ChrisDevinePimss picture ChrisDevinePimss  ·  3Comments