问题描述
只需在Google Maps JavaScript API的新版本3.12中尝试新选项 div>
你仍然可以在InfoWindow中使用自己的字体。只需提供HTML内容而不是纯文本,并且可以使用内联CSS或样式表以任何方式设置样式。这个中的例子:
var infowindow = new google.maps.InfoWindow({
map:map,
position:center,
content:'< div class =myinfo>计算机历史记录<<< ; / div>'
});
使用此CSS:
.myinfo {font-family:Georgia,serif;字体大小:18像素; }
Just trying the new option google.maps.visualRefresh = true in the new version 3.12 of the Google maps javascript API. And although the map new look is great, now the text in my InfoWindows is using the font size Roboto.
The new InfoWindow content div CSS is:
font-family: Roboto, Arial, sans-serif; font-size: 13px; font-weight: 300;
This wasn't the case before and it doesn't work at all with the design of my website. Any idea how I could remove it to use the default font define in my body?
You can still use your own font in an InfoWindow. Simply provide HTML content instead of plain text, and you can style it any way you want with inline CSS or a stylesheet. Example in this fiddle:
var infowindow = new google.maps.InfoWindow({ map: map, position: center, content: '<div class="myinfo">Computer History!</div>' });
using this CSS:
.myinfo { font-family:Georgia,serif; font-size:18px; }
这篇关于Google Maps可视化刷新 - 如何在InfoWindow中禁用字体Roboto的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!