Angular2 -google-maps click-event for marker

Is anyone familiar with this library ?: https://angular-maps.com/ If possible, someone will help me create a click event on the marker, I tried this:

 <sebm-google-map-marker *ngFor="#location of locations" (click)="updateDiv()"
[latitude]="location.lat" [longitude]="location.lng" [label]="location.id">

updateDiv() {
console.log('check');
}

But it doesn't seem to work? What am I doing wrong?

+4
source share
2 answers

I think you can try the following ( markerClickevent instead click):

<sebm-google-map-marker *ngFor="#location of locations"   
  (markerClick)="updateDiv()" [latitude]="location.lat"
  [longitude]="location.lng" [label]="location.id">

updateDiv() {
  console.log('check');
}

See this document in the Outputs section:

+9
source

You need to use markerClickinstead clickas follows:

(markerClick)="updateDiv()"

. https://angular-maps.com/docs/api/latest/ts/core/SebmGoogleMapMarker-directive.html#Outputs

+3

All Articles