Skip to content

Commit

Permalink
Do an intersects test rather than a contains when testing for a zoom …
Browse files Browse the repository at this point in the history
…in. Fixes Leaflet#344
  • Loading branch information
danzel committed Apr 22, 2014
1 parent f865dc1 commit 254198a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/old-bugs/click-cluster-at-screen-edge.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<body>

<div id="map"></div>
<span>Bug <a href="https://github.com/danzel/Leaflet.markercluster/issues/344">#344</a>. Click the cluster at the screen edge. Map will zoom to it and its markers will appear, but it will not disappear.</span><br/>
<span>Bug <a href="https://github.com/leaflet/Leaflet.markercluster/issues/344">#344</a>. Click the cluster at the screen edge. Map will zoom to it and its markers will appear, but it will not disappear.</span><br/>
<span id="time"></span>
<script type="text/javascript">

Expand Down
2 changes: 1 addition & 1 deletion src/MarkerClusterGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
//Incase we are starting to split before the animation finished
this._processQueue();

if (this._zoom < this._map._zoom && this._currentShownBounds.contains(this._getExpandedVisibleBounds())) { //Zoom in, split
if (this._zoom < this._map._zoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split
this._animationStart();
//Remove clusters now off screen
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, this._getExpandedVisibleBounds());
Expand Down

0 comments on commit 254198a

Please sign in to comment.