gpt4 book ai didi

javascript - 如何设置谷歌地图信息窗口的样式

转载 作者:行者123 更新时间:2023-11-27 23:01:44 25 4
gpt4 key购买 nike

我有一个 vue-google-map,它需要在点击标记时显示一些内容。如何设置 infoWindow 的样式?这是我的代码,将 id iw-container 调用到 css 表中。

    this.infoWindow.position = location;
this.infoWindow.template = '<div class="iw-container"><div
style="width:100%;">NAME OF PIN</div>'
+ '<div style="width:100%;">name and info</div></div>';
this.infoWindow.open = true;

这是CSS:

#iw-container {
background-color:pink;
}

但是 infoWindow 没有任何变化。

我也尝试像这样将样式直接设置到内容中:

this.infoWindow.position = location;
this.infoWindow.template = '<div style="background-color:pink;"><div
style="width:100%;">NAME OF PIN</div>'
+ '<div style="width:100%;">name and info</div></div>';
this.infoWindow.open = true;

但是颜色并没有完全实现信息窗口。谁能建议我能做什么或我应该改变什么?

最佳答案

在您的 css 代码中,您使用“#”作为类选择器使用“.”

.iw-container {
background-color:pink;
}

关于javascript - 如何设置谷歌地图信息窗口的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58945600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com