z-Index overlay in google maps version 3

前端 未结 6 2011
死守一世寂寞
死守一世寂寞 2020-12-08 20:30

I\'m trying to get an overlay in google maps api v3 to appear above all markers. But it seems that the google api always put my overlay with lowest z-index priority. Only so

6条回答
  •  死守一世寂寞
    2020-12-08 21:21

    Disclaimer: this is a dodgy solution that may stop working at any time and you definitely shouldn't use this in production.

    For those looking for a quick and dirty solution, this CSS worked for me:

    .gm-style > div:first-child > div:first-child > div:nth-child(4) {
      z-index: 99 !important;
    }
    

    Use at your own risk!

提交回复
热议问题