Clear _spiderfied on a zoomend unspiderfy. Fixes #268

This commit is contained in:
danzel
2013-10-31 16:48:32 +13:00
parent cf40d8aa86
commit a47562c5c6
2 changed files with 24 additions and 0 deletions
+22
View File
@@ -67,4 +67,26 @@
expect(marker._container.parentNode).to.be(map._pathRoot);
expect(marker2._container.parentNode).to.be(map._pathRoot);
});
describe('zoomend event listener', function () {
it('unspiderfies correctly', function () {
var group = new L.MarkerClusterGroup();
var marker = new L.Circle([1.5, 1.5], 10);
var marker2 = new L.Circle([1.5, 1.5], 10);
group.addLayer(marker);
group.addLayer(marker2);
map.addLayer(group);
marker.__parent.spiderfy();
expect(group._spiderfied).to.not.be(null);
map.fire('zoomend');
//We should unspiderfy with no animation, so this should be null
expect(group._spiderfied).to.be(null);
});
});
});
+2
View File
@@ -111,6 +111,8 @@ L.MarkerCluster.include({
delete m._spiderLeg;
}
}
group._spiderfied = null;
}
});