Update the build

This commit is contained in:
danzel
2012-07-30 11:59:18 +12:00
parent e0d2616925
commit 94e3d4f6dd
2 changed files with 20 additions and 2 deletions
+19 -1
View File
@@ -74,7 +74,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
onAdd: function (map) {
L.FeatureGroup.prototype.onAdd.call(this, map);
this._generateInitialClusters();
if (!this._topClusterLevel) {
this._generateInitialClusters();
}
this._map.on('zoomend', this._zoomEnd, this);
this._map.on('moveend', this._moveEnd, this);
@@ -85,6 +87,18 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
this._bindEvents();
},
//Overrides FeatureGroup.onRemove
onRemove: function (map) {
this._map.off('zoomend', this._zoomEnd, this);
this._map.off('moveend', this._moveEnd, this);
if (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
this._spiderfierOnRemove();
}
L.FeatureGroup.prototype.onRemove.call(this, map);
},
//Overrides FeatureGroup._propagateEvent
_propagateEvent: function (e) {
if (e.target instanceof L.MarkerCluster) {
@@ -1383,6 +1397,10 @@ L.MarkerClusterGroup.include({
}
},
_spiderfierOnRemove: function () {
this._map.off('click zoomstart', this._unspiderfy, this);
},
_unspiderfy: function () {
if (this._spiderfied) {
this._spiderfied.unspiderfy();
+1 -1
View File
File diff suppressed because one or more lines are too long