Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps api 3 悬停时markerclustererplus css更改_Google Maps Api 3_Markerclusterer - Fatal编程技术网

Google maps api 3 悬停时markerclustererplus css更改

Google maps api 3 悬停时markerclustererplus css更改,google-maps-api-3,markerclusterer,Google Maps Api 3,Markerclusterer,我正在使用GoogleMapsAPIv3和MarkerClustererPlus库。我不希望使用光栅图标,而是使用MarkerClusterer对象的styles和ClusterClass属性渲染气泡。这是我在JS代码中的style对象: var myClusterStyle = [{ url: './icons/placeholder.png', //1x1 transparent png height: 40, width: 40,

我正在使用GoogleMapsAPIv3和MarkerClustererPlus库。我不希望使用光栅图标,而是使用MarkerClusterer对象的
styles
ClusterClass
属性渲染气泡。这是我在JS代码中的
style
对象:

var myClusterStyle = [{
        url: './icons/placeholder.png', //1x1 transparent png
        height: 40,
        width: 40,
        textColor: '#636363',
        textSize: 12
}];
和CSS类:

.cluster {
    background-color: #EAE6DE;
    border-radius: 50%;
    border: 3px solid #ACCCFD;
    position: absolute; 
}
这些是带蓝色边框的灰色泡泡

我的问题是:

我想更改鼠标上方单个气泡的一些属性,比如更改颜色或添加阴影。我可以更改气泡的CSS类吗?我花了很多时间想弄明白这一点,现在我被卡住了。我有这个活动:

google.maps.event.addListener(mc,'mouseover',function(c){

    c.clusterIcon_.setValues({className_:'clusterHover'});
});
它确实改变了气泡的CSS类选项,但是显示没有改变。。。下面的
mc.repaint()、c.clusterIcon\uuu.draw()
没有帮助

我看到了这条线索:
但这是为了更改图标,而不是样式属性。在不修改库的情况下,这真的可能吗?任何帮助都将不胜感激。

您可以直接设置div的级别:

c.clusterIcon_.div_.className='clusterHover'
但是当您使用
:hover
-伪类时,它会容易得多

.cluster:hover {
    /* some styles */
}