GMaps V3 InfoWindow - disable the close “x” button

前端 未结 22 932
青春惊慌失措
青春惊慌失措 2020-12-05 09:14

From what I see, in v2 of GMaps API there was a property \"buttons\" of the InfoWindow object that one could define in a way that given InfoWindow has no close button:

22条回答
  •  有刺的猬
    2020-12-05 10:17

    You can use this. This will not hide other images like zoom control, pan control etc. on dom ready of info window you can use this.

    google.maps.event.addListener(infoWindow, 'domready', function () {
    
          document.querySelector(".gm-style-iw").nextElementSibling.style.display = "none";
    });
    

提交回复
热议问题