0

私はこのツールを使用しています

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/

正確な場所または非常に近い場所にあるマーカーのクラスタリング用 ( gridSize: 5)

私がやりたいことは、クリック時にクラスター(すべてではなく、1つだけ)を削除し、マーカーをspiderfyで削除することです

https://github.com/jawj/OverlappingMarkerSpiderfier

これはできますか?

Marker clusterer を参照して、特定のクラスターを削除する関数/メソッドが見つかりませんでした。

事前にt​​hx。

4

1 に答える 1

1

少し変更を加えて、MarkerClustererPlus の独自のバージョンを使用します。

//@150 of MarkerClustererPlus: modify to send cClusterIcon.div_ on the click event
google.maps.event.trigger(mc, "click", cClusterIcon.cluster_, cClusterIcon.div_);

そして、コードでは次のように使用します。

google.maps.event.addListener(markerCluster, 'click', function (cluster, clusterIcon) {
    clusterIcon.remove();
    //Do the other stuff with the markers ...
    var markers = cluster.getMarkers();
});
于 2014-11-26T12:49:31.727 に答える