Check if infowindow is opened Google Maps v3

前端 未结 5 912
小鲜肉
小鲜肉 2020-12-28 12:16

Please, I need a help.

I want to check if my infowindow is opened.

For example:

if (infowindow.isOpened)
{
   doSomething()
}
5条回答
  •  太阳男子
    2020-12-28 13:01

    Until google doesn't give us any better way of doing this, you can add a property to the infoWindow objects. Something like:

    google.maps.InfoWindow.prototype.opened = false;
    infoWindow = new google.maps.InfoWindow({content: '

    Olá mundo

    '}); if(infoWindow.opened){ // do something infoWindow.opened = false; } else{ // do something else infoWindow.opened = true; }

提交回复
热议问题