[Pkg-javascript-commits] [leaflet-markercluster] 08/31: README for fitBounds options Pass undefined

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 4a23996060fc6713b44e0015b65bf394673cb8ea
Author: Tim Kelty <tim at fusionary.com>
Date:   Mon Apr 24 09:49:49 2017 -0400

    README for fitBounds options
    Pass undefined
---
 README.md            | 4 +++-
 src/MarkerCluster.js | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 4146ba9..d3baba2 100644
--- a/README.md
+++ b/README.md
@@ -245,10 +245,12 @@ markers.on('clusterclick', function (a) {
 #### Zooming to the bounds of a cluster
 When you receive an event from a cluster you can zoom to its bounds in one easy step.
 If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead.
+`zoomToBounds` takes an optional argument to pass [options to the resulting `fitBounds` call](http://leafletjs.com/reference.html#map-fitboundsoptions).
+
 See [marker-clustering-zoomtobounds.html](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example.
 ```javascript
 markers.on('clusterclick', function (a) {
-	a.layer.zoomToBounds();
+	a.layer.zoomToBounds({padding: [20, 20]});
 });
 ```
 
diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 75ffb0c..e3f4de2 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -45,8 +45,6 @@ L.MarkerCluster = L.Marker.extend({
 
 	//Zoom to the minimum of showing all of the child markers, or the extents of this cluster
 	zoomToBounds: function (fitBoundsOptions) {
-        fitBoundsOptions = fitBoundsOptions || {};
-
 		var childClusters = this._childClusters.slice(),
 			map = this._group._map,
 			boundsZoom = map.getBoundsZoom(this._bounds),

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