[Pkg-javascript-commits] [leaflet-markercluster] 120/479: For mobile set the expanded bounds to just the screen, this means there is only 1/9th the clusters on screen which gives much better performance. During a zoom/drag on mobile the map tiles aren't updating anyway, so this fits with them. Refs #19
Jonas Smedegaard
dr at jones.dk
Thu Oct 16 16:00:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet-markercluster.
commit a0f4a18df82ccf90ef71f369ca8c1aad3630c260
Author: danzel <danzel at localhost.geek.nz>
Date: Thu Jul 26 13:10:10 2012 +1200
For mobile set the expanded bounds to just the screen, this means there is only 1/9th the clusters on screen which gives much better performance. During a zoom/drag on mobile the map tiles aren't updating anyway, so this fits with them. Refs #19
---
src/MarkerClusterGroup.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index e4d4be2..52a51b6 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -310,8 +310,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
_getExpandedVisibleBounds: function () {
var map = this._map,
bounds = map.getPixelBounds(),
- width = Math.abs(bounds.max.x - bounds.min.x),
- height = Math.abs(bounds.max.y - bounds.min.y),
+ width = L.Browser.mobile ? 0 : Math.abs(bounds.max.x - bounds.min.x),
+ height = L.Browser.mobile ? 0 : Math.abs(bounds.max.y - bounds.min.y),
sw = map.unproject(new L.Point(bounds.min.x - width, bounds.min.y - height)),
ne = map.unproject(new L.Point(bounds.max.x + width, bounds.max.y + height));
--
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