[Pkg-javascript-commits] [leaflet-markercluster] 49/219: 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.
Jonas Smedegaard
dr at jones.dk
Sat May 7 09:39:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit ab3cdd49a1d0b23eef97f2087656210886aa5552
Author: Ryan "rman" Denniston <r.denniston at gmail.com>
Date: Fri Oct 31 23:28:32 2014 -1000
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.
---
src/MarkerClusterGroup.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 03e4275..58794c3 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -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();
}
--
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