z-Index overlay in google maps version 3

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

    You can't change the zIndex of an OverlayView (it has no such property), but it holds panes that contains DOM nodes. That's where you can use the z-index property;

    ...
    lngLatXYposition = $.view.overlay.getPanes().overlayLayer.style['zIndex'] = 1001;
    ...
    

提交回复
热议问题