[Pkg-javascript-commits] [leaflet-markercluster] 07/31: Allow paddling fitBounds options to zoomToBounds

Jonas Smedegaard dr at jones.dk
Sun Oct 22 17:29:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag upstream/1.1.0_dfsg
in repository leaflet-markercluster.

commit 97c3bb09328d496f9b2914a9eb968e36e46b9ed6
Author: Tim Kelty <tim at fusionary.com>
Date:   Fri Apr 21 12:02:09 2017 -0400

    Allow paddling fitBounds options to zoomToBounds
---
 src/MarkerCluster.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 7df16dd..75ffb0c 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -44,7 +44,9 @@ L.MarkerCluster = L.Marker.extend({
 	},
 
 	//Zoom to the minimum of showing all of the child markers, or the extents of this cluster
-	zoomToBounds: function () {
+	zoomToBounds: function (fitBoundsOptions) {
+        fitBoundsOptions = fitBoundsOptions || {};
+
 		var childClusters = this._childClusters.slice(),
 			map = this._group._map,
 			boundsZoom = map.getBoundsZoom(this._bounds),
@@ -67,7 +69,7 @@ L.MarkerCluster = L.Marker.extend({
 		} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead
 			this._group._map.setView(this._latlng, mapZoom + 1);
 		} else {
-			this._group._map.fitBounds(this._bounds);
+			this._group._map.fitBounds(this._bounds, fitBoundsOptions);
 		}
 	},
 

-- 
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