singleInfoWindow attribute doesn't work [2.0-preview]
jonadeline opened this issue · comments
Hi there,
The singleInfoWindow
doesn't seem to have any effect on infoWindow behavior. When clicking a marker all the previous opened info windows remain open.
This behavior has been experienced using 2.0-preview branch of google-map component.
Here is a JSBin demonstrating the issue : https://jsbin.com/qiboluq/edit?html,console,output
Here is a workaround in case someone needs one :
<google-map-marker on-google-map-marker-click="_handleMarkerClick">
_handleMarkerClick(event) {
const currentMarker = event.currentTarget;
const gmapMarkerEls = this.shadowRoot.querySelectorAll('google-map-marker');
gmapMarkerEls.forEach((gmapMarker) => {
if (currentMarker !== gmapMarker) {
gmapMarker.info.close();
}
});
}
My bad it works correctly.