0
我正在制作一个包含群集的地图,我想在其下显示群集列表。获取markerclusterer群集
为了获得簇,我试图从对象中检索它们。但是,如我所料不工作:
// Initialize clusterer
markerCluster = new MarkerClusterer(map, markers, clusterOptions);
// this logs an empty array
var clusters = markerCluster.clusters_;
console.log(clusters);
// This logs array of clusters
setTimeout(function(){
var clusters = markerCluster.clusters_;
console.log(clusters);
}, 500)
所以我试图找出是否有一个onload事件或回调函数..
[Marker Clusterer Plus not working]的可能重复(http://stackoverflow.com/questions/17672295/marker-clusterer-plus-not-working) – geocodezip