Google Maps可视化刷新 - 如何在InfoWindow中禁用字体Roboto [英] Google Maps visual refresh - how do disable font Roboto in InfoWindow

查看:144
本文介绍了Google Maps可视化刷新 - 如何在InfoWindow中禁用字体Roboto的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需在Google Maps JavaScript API的新版本3.12中尝试新选项 google.maps.visualRefresh = true 即可。虽然地图新外观很好,但是现在我的InfoWindows中的文本正在使用字体大小Roboto。

新的InfoWindow content div CSS是:

  font-family :Roboto,Arial,sans-serif; 
font-size:13px;
font-weight:300;

以前不是这样,它根本不适用于我的网站设计。任何想法如何删除它以使用我的体内的默认字体定义

解决方案 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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