这是我用来调用集群的代码。除非在同一位置有多个标记,否则它将起作用
var markers = features.map(function(location, i) {
return new google.maps.Marker({
position: features[i].position,
icon: icon,
map: map,
title: features[i].title,
label: features[i].title,
url: features[i].url
});
});
for (index = 0; index < markers.length; ++index) {
google.maps.event.addListener(markers[index], 'click', function() {
window.location.href = this.url;
});
}
var markerCluster = new MarkerClusterer(map, markers,
{imagePath: '/wp-content/themes/spikes/icon/m'});