1
我的应用程序中有以下代码,所有标记都添加到一个组中。我希望在加载地图时,群集中未折叠的标记弹出窗口显示它们的弹出窗口。 (标记,其是群集的一部分,但不折叠成集群上的特定缩放级别,当映射在该缩放等级加载)传单markercluster加载时打开弹出框
var markers = [{
"latLong": [57.67, -3.89]
},
{
"latLong": [-4.4, -58.34]
},
{
"latLong": [35.79, 139.48]
}],
markerGroup = L.markerClusterGroup(),
marker;
markers.forEach(function (markerConfig, index) {
marker = new L.Marker(new L.LatLng(markerConfig.latLong[0], markerConfig.latLong[1]));
marker.bindPopup(index, {
"autoClose": false,
"closeOnClick": false
}).openPopup();
markerGroup.addLayer(marker);
});
clusterMap.addLayer(markerGroup);
我想上标记的openPopup()方法,以打开弹出当加载地图时,它会在点击标记时打开。请帮忙。