[Pkg-javascript-commits] [leaflet] 132/301: add maxZoom to Map fitBounds options, close #2101

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:46 UTC 2014


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

js pushed a commit to branch master
in repository leaflet.

commit c3734e5a91bdfa850339ff797e876f2dba9d9cfd
Author: Vladimir Agafonkin <agafonkin at gmail.com>
Date:   Thu Oct 17 00:17:31 2013 +0300

    add maxZoom to Map fitBounds options, close #2101
---
 src/map/Map.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/map/Map.js b/src/map/Map.js
index 4fd5d5f..35b7739 100644
--- a/src/map/Map.js
+++ b/src/map/Map.js
@@ -103,6 +103,8 @@ L.Map = L.Class.extend({
 		    nePoint = this.project(bounds.getNorthEast(), zoom),
 		    center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);
 
+		zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom;
+
 		return this.setView(center, zoom, options);
 	},
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git



More information about the Pkg-javascript-commits mailing list