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