GMaps V3 InfoWindow - disable the close “x” button

前端 未结 22 1080
青春惊慌失措
青春惊慌失措 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条回答
  •  猫巷女王i
    2020-12-05 10:02

    You can also do it through the css.

    .gm-style-iw + div {display: none;}
    

    edit january 2019
    as @antmeehan said in the comment,

    Google have changed the HTML, and the close button is now a button element rather than a div

    So the css code to hide the "x" button is now:

    .gm-style-iw + button {display: none;}
    

提交回复
热议问题