【问题标题】:GoogleMap API infoWindow does not become transparentGoogleMap API infoWindow 不会变得透明
【发布时间】:2019-08-05 05:32:42
【问题描述】:

我想以半透明的方式显示谷歌地图 API 信息窗口。 因为我为了显示带有许多数据的大型信息窗口。 在 infoWindow 地图的图像隐藏下。 但我无法通过 InforWindow 的 boxClass 属性应用透明(CSS 不透明度)。

请提出解决方案,如何解决这个问题?

非常感谢。

[我的代码]

   var infowindow = new google.maps.InfoWindow({
    // content from custom function with many datas i made //
    content: infowincontentHTMLDoor(nmfacil, lat, lon, addrfacil),
    maxWidth: 720,
    boxClass: "infowinclass"  // ?????????
  });
infowindow.open(map, marker);


<style type="text/css">
    .infowinclass {
      opacity: 0.5;  
    }
</style>   

【问题讨论】:

标签: css google-maps google-maps-api-3


【解决方案1】:

自行解决。 我应用CSS如下

.gm-style > div > div > div > div > div {
  opacity: 0.6;
}

【讨论】:

  • 现在可能会解决问题,但这是未记录的,并且类名和 HTML 结构可能随时更改。
  • 除了前面的评论,如果你想改变它,我建议你使用Custom Popups 而不是 infowindow,因为 infowindow 类不提供自定义,这也可能导致未来的问题.
猜你喜欢
  • 1970-01-01
  • 2013-05-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-13
  • 2018-11-24
相关资源
最近更新 更多