Google Maps MarkerClusterer忽略了几个样式属性

Google Maps MarkerClusterer ignores several styling properties

本文关键字:几个 样式 属性 MarkerClusterer Maps Google      更新时间:2023-09-26

我正在使用Google Maps MarkerClusterer来聚类地图标记(谁会想到!)。我遇到的问题是,某些样式属性不会影响标记。

以下是可用于 http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html 的所有属性的列表

属性heighttextSizetextColorurlwidth工作没有任何问题。但是当试图改变fontWeight时,什么也没发生。我已经用这些道具试过了。

var styles = [[{
    url: imagePath,
    width: x,
    height: y,
    anchor: [0, 0],
    textColor: '#ffffff',
    textSize: 20,
    fontWeight: 100 // as well as `fontWeight: 'normal'`
}]];

但仍然没有变化。还有其他人有同样的问题吗?

在文档中,它说fontweight值必须是一个字符串,但你发送的是一个数字。你能试试fontWeight: '100'吗?