【问题标题】:How to change font of MarkerWithLabel Google Maps API V3如何更改 MarkerWithLabel Google Maps API V3 的字体
【发布时间】:2013-09-20 21:36:24
【问题描述】:

如何使用 Google Maps API v3 在我的应用程序中更改标签标记的字体? 我换成 Lato 后仍然是“arial”,为什么? :( 代码:

  .labels {
 color: red;
 background-image:url('testemark.png');
 font-family: 'Lato', sans-serif;
 font-size: 10px;
 font-weight: bold;
 text-align: center;
 width: 77px;  
padding-top:5px;
padding-left:7.5px;
height:23px;
}

var marker2 = new MarkerWithLabel({
      position: new google.maps.LatLng(10,20),
      map: map,
      labelContent: "example2",
      labelAnchor: new google.maps.Point(10, 20),
      labelClass: "labels", // the CSS class for the label
    });

谢谢

【问题讨论】:

标签: google-maps google-maps-api-3 fonts


【解决方案1】:

在格式中添加important-规则:

font-family: 'Lato', sans-serif !important;

【讨论】:

  • 如果这真的是答案,我印象深刻。 +1
猜你喜欢
  • 1970-01-01
  • 2011-12-25
  • 1970-01-01
  • 1970-01-01
  • 2013-04-18
  • 1970-01-01
  • 1970-01-01
  • 2014-10-20
  • 2010-12-28
相关资源
最近更新 更多