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

This commit is contained in:
danzel
2012-07-26 13:10:10 +12:00
parent f995563c42
commit a0f4a18df8
+2 -2
View File
@@ -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));