Add zoomToBounds to MarkerCluster. Fixes #6

This commit is contained in:
danzel
2012-07-17 14:07:52 +12:00
parent 9161de52cc
commit 02adc3a1b1
+5
View File
@@ -29,6 +29,11 @@ L.MarkerCluster = L.Marker.extend({
return storageArray;
},
//Zoom to the extents of this cluster
zoomToBounds: function () {
this._group._map.fitBounds(this._bounds);
},
_baseInit: function () {
L.Marker.prototype.initialize.call(this, this._latlng, { icon: this._group.options.iconCreateFunction(this._childCount) });
},