Closing any open info windows in google maps api v3

后端 未结 6 1433
旧时难觅i
旧时难觅i 2021-01-31 03:25

As the title states, on a given event (for me this happens to be upon opening a new google.maps.InfoWindow I want to be able to close any other currently open info

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 04:23

    You need just one line: $(".gm-style-iw").next().click();

    There's a div with this class, 'gm-style-iw', inside the infowindow. After, there is the div of the close button. So, this code will click every infowindow close button existing in the map

提交回复
热议问题