Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
Javascript 如何在MarkerClusterGroup中设置每个群集的选项_Javascript_Leaflet_Leaflet.markercluster - Fatal编程技术网

Javascript 如何在MarkerClusterGroup中设置每个群集的选项

Javascript 如何在MarkerClusterGroup中设置每个群集的选项,javascript,leaflet,leaflet.markercluster,Javascript,Leaflet,Leaflet.markercluster,我使用以下方法创建自己的MarkerClusterGroup: this.cluster = leaflet.markerClusterGroup({ zoomToBoundsOnClick: false, showCoverageOnHover: false, spiderfyDistanceMultiplier: 3, spiderLegPolylineOptions: { weight: 1.5, color: "#1BA5D

我使用以下方法创建自己的MarkerClusterGroup:

this.cluster = leaflet.markerClusterGroup({
    zoomToBoundsOnClick: false,
    showCoverageOnHover: false,
    spiderfyDistanceMultiplier: 3,
    spiderLegPolylineOptions: {
        weight: 1.5,
        color: "#1BA5D0",
        lineCap: "butt",
        dashArray: "10 10",
        opacity: 0.5
    }
});
如何为该组中的每个簇应用一些选项(只要它实际上是传单.Marker)?特别是,我想设置
riseonhaver:true


我发现用自定义窗格控制整个MarkerClusterGroup定位是有困难的,但这不是我的情况

最后,我找到了答案。可在
iconCreateFunction
内设置选项:

this.cluster = leaflet.markerClusterGroup({
    iconCreateFunction: cluster => {
        cluster.options.riseOnHover = true;
    }
});