[Pkg-javascript-commits] [leaflet-markercluster] 108/479: Working towards getting addLayer/removeLayer working again
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit 7ceb7b01dbc255ff92af40f5b8ba5778cc40af15
Author: danzel <danzel at localhost.geek.nz>
Date: Wed Jul 25 15:33:57 2012 +1200
Working towards getting addLayer/removeLayer working again
---
src/MarkerCluster.js | 2 +-
src/MarkerClusterGroup.js | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 4b9ed04..e510902 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -115,7 +115,7 @@ L.MarkerCluster = L.Marker.extend({
}
if (result) {
- if (!this._zoom) {
+ if (!('_zoom' in this)) {
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
}
this._recalculateBounds();
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 88faebe..6f57ab0 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -257,8 +257,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds());
},
_animationAddLayer: function (layer, newCluster) {
- L.FeatureGroup.prototype.addLayer.call(this, newCluster);
- if (newCluster !== layer && newCluster._childCount === 2) {
+ L.FeatureGroup.prototype.addLayer.call(this, layer);
+ if (newCluster !== true && newCluster._childCount === 2) {
newCluster._recursivelyRemoveChildrenFromMap(newCluster._bounds, 1);
}
}
@@ -377,7 +377,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
var me = this;
L.FeatureGroup.prototype.addLayer.call(this, layer);
- if (newCluster !== layer) {
+ if (newCluster !== true) {
if (newCluster._childCount > 2) { //Was already a cluster
this._forceLayout();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git
More information about the Pkg-javascript-commits
mailing list