谷歌地图Javascript部分导致文本变为粗体

时间:2014-11-07 15:20:42

标签: javascript html google-maps

以下是影响它的代码:

<script type="text/javascript">
    function initialize() {
      var latLng = new google.maps.LatLng(51.4893169, -2.1182648);
      var mapOptions = {
        center: latLng,
        zoom: 15,
        scrollwheel: false,
      };
      var map = new google.maps.Map(document.getElementById('map-canvas'),
        mapOptions);
      var image = 'images/map_blue.png';
      var marker = new google.maps.Marker({
        position: latLng,
        map: map,
        icon: image
      });
    }
    google.maps.event.addDomListener(window, 'load', initialize);
  </script>

它使我的一些文字变粗,在Google检查元素中没有显示任何粗体或字体重量。但是,如果我删除所述代码^然后它修复了自己..

这让我很困惑,因为我无法看到这两者是如何相关的。我检查了我的html中缺少的字符,但它的完美(在网站上也经过验证)..

干杯伙伴

1 个答案:

答案 0 :(得分:4)

有同样的问题,原因是页面使用字体&#34; Roboto&#34;使用font-weight:300,但谷歌地图加载此字体的重量为300,400,500,700所以&#34;正常&#34; eq 400,而不是300,文字变得更大胆