如何将默认的谷歌地图信息窗口滚动条移动到关闭按钮的右侧

How to move the default google maps information window scrollbar to the right of the close button?

本文关键字:滚动条 移动 关闭按钮 窗口 信息窗 默认 谷歌地图 信息      更新时间:2023-09-26

显示信息窗口的滚动条时,它显示在X按钮的左侧,并在窗口内容的右侧占据相当大的空间。当添加以下CSS时,滚动条会显示:

.mapInfoWindow {
    max-height:100px;
    overflow-y: auto;
}

我想把滚动条移到关闭按钮的右边。

我该怎么做?

以上这些我都找不到任何帮助。

将ininfowindow内容用div标签包起来用:

样式化DIV标签
line-height:1.35;
overflow:hidden;
white-space:nowrap;

overflow:hidden和white-space:nowrap都确保不显示滚动条。但是,长文本可能溢出到InfoWindow之外。

var infowindow = new google.maps.InfoWindow({content: '<div style="line-height:1.35;overflow:hidden;white-space:nowrap;">ADD CONTENT</div>'});

希望能有所帮助