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

alexweber picture alexweber  路  4Comments

supran2811 picture supran2811  路  4Comments

stot3 picture stot3  路  3Comments

marcelinobadin picture marcelinobadin  路  3Comments

maneesht picture maneesht  路  3Comments