如何设置Google地图标记的infowindow最大高度? [英] How to set Google map's marker's infowindow max height?

查看:247
本文介绍了如何设置Google地图标记的infowindow最大高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果标记的信息窗口的内容太长,它不适合窗口,它会在底部溢出。我该如何解决这个问题?解析方案

这个问题也可能是由于继承的样式应用于信息窗口内容之后的结果已附加到地图上。例如:字体大小将根据默认字体计算。附加信息窗口时,字体将根据继承的CSS进行更改,如果较大,则会溢出信息窗口底部。



如果您不想删除继承的样式(大多数情况下您不需要),您需要显式地在信息窗口内容中反转继承的样式。



您可以找到一个很好的描述这个问题,它的解决方案在:



修复'继承的CSS'问题


If the contents of the info window of marker is too long, it won't fit into the window, it will overflow at the bottom. How can I fix this?

解决方案

This problem can also be a result of inherited styles being applied to the info window contents after it has been attached to the map.

For instance: The font size will be calculated based on the default font. When the info window is attached, the font will change based on the inherited CSS and, if it is larger, will overflow of the bottom of the info window.

If you don't want to remove the inherited style (and mostly you don't), you need to explicitly countermand the inherited style in the info window content.

You can find an excellent description of this problem and it's solution at:

Fixing the 'inherited CSS' problem

这篇关于如何设置Google地图标记的infowindow最大高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆