z-Index overlay in google maps version 3

前端 未结 6 2027
死守一世寂寞
死守一世寂寞 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:37

    Use panes.overlayMouseTarget.appendChild

    If you want to allow your layer to be targetable through mouse clicks (and use events such as "click" or CSS pseudo ::hover) then you should add your overlay to the map using overlayMouseTarget

    var panes = this.getPanes();

    panes.overlayMouseTarget.appendChild(this.div_);

    Also see: https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapPanes

提交回复
热议问题