Permalink
Browse files

Make us not crash if we have a spidified cluster and it has a marker …

…added to it. Fixes #114 bug 2
  • Loading branch information...
danzel committed Jan 8, 2013
1 parent 4afda97 commit 1566118ac5865b46e3432238d867357bcf51f3d2
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/MarkerCluster.Spiderfier.js
@@ -249,6 +249,11 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
+ //Marker was added to us after we were spidified
+ if (!m._preSpiderfyLatlng) {
+ continue;
+ }
+
//Fix up the location to the real one
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;

0 comments on commit 1566118

Please sign in to comment.