Fixups for singleMarkerMode with new cluster icon bits

This commit is contained in:
danzel
2012-09-03 09:22:28 +12:00
parent 068d323b9c
commit 40441542d2
2 changed files with 11 additions and 4 deletions
-4
View File
@@ -52,10 +52,6 @@ L.MarkerCluster = L.Marker.extend({
this._childClusters.push(new1);
this._childCount += new1._childCount;
} else {
if (this._group.options.singleMarkerMode === true) {
new1.options.icon = this._group.options.iconCreateFunction(1);
}
this._markers.push(new1);
this._childCount++;
}
+11
View File
@@ -43,6 +43,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
return this;
}
if (this.options.singleMarkerMode) {
layer.options.icon = this.options.iconCreateFunction({
getChildCount: function () {
return 1;
},
getAllChildMarkers: function () {
return [layer];
}
});
}
if (!this._map) {
this._needsClustering.push(layer);
return this;