made a minor change to _zoomOrSpiderfy to Spiderfy without zooming if everything in the cluster is at the same lat long. This prevents zooming into max level if there is no real reason to do so, since all points will be at the same location. This minor change increased usability in a personal project.

This commit is contained in:
Ryan "rman" Denniston
2014-10-31 23:28:32 -10:00
parent e85282a015
commit ab3cdd49a1
+5 -1
View File
@@ -655,7 +655,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
_zoomOrSpiderfy: function (e) {
var map = this._map;
if (map.getMaxZoom() === map.getZoom()) {
if (e.layer._bounds._northEast.equals(e.layer._bounds._southWest)){
if (this.options.spiderfyOnMaxZoom) {
e.layer.spiderfy();
}
}else if (map.getMaxZoom() === map.getZoom()) {
if (this.options.spiderfyOnMaxZoom) {
e.layer.spiderfy();
}