0

Is there a way to show/ hide infoWindow for a marker on click of something like button etc.

I have a scenario where I have loaded markers and infoWindow content from my JSON on the map, and have associated images on the page. I need to show the corresponding infoWindow on click of the image.

When I click the marker on the map, I am able to see the infoWindow. But I want to reproduce the same thing on click of the image.

A nudge towards the approach would be a great help.

1 Answers1

0

This is a visible property. https://angular-maps.com/docs/api/latest/ts/core/index/SebmGoogleMapMarker-directive.html

<sebm-google-map-marker 
[latitude]="lat" 
[longitude]="lng" 
[label]="'M'" 
visible="visible" 
(markerClick)="markerClick()">
 </sebm-google-map-marker>

Put a (markerClick)="markerClick()" event on the and update the visible variable.

private visible: boolean = true;
markerClick() {
  this.visible = !this.visible;
}
Gavin Bruce
  • 1,799
  • 16
  • 28