[Pkg-javascript-commits] [leaflet] 253/301: adjust whitespace and add some comments
Jonas Smedegaard
js at moszumanska.debian.org
Mon Jan 27 22:22:55 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 fab5c3b6763f9cc6b00d5cd0660205aa71b32283
Author: Vladimir Agafonkin <agafonkin at gmail.com>
Date: Thu Nov 14 18:04:39 2013 +0200
adjust whitespace and add some comments
---
src/map/Map.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/map/Map.js b/src/map/Map.js
index 0085f40..b073e7a 100644
--- a/src/map/Map.js
+++ b/src/map/Map.js
@@ -757,6 +757,7 @@ L.Map = L.Class.extend({
return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());
},
+ // adjust center for view to get inside bounds
_limitCenter: function (center, zoom, bounds) {
if (!bounds) { return center; }
@@ -769,15 +770,17 @@ L.Map = L.Class.extend({
return this.unproject(centerPoint.add(offset), zoom);
},
+ // adjust offset for view to get inside bounds
_limitOffset: function (offset, bounds) {
if (!bounds) { return offset; }
var viewBounds = this.getPixelBounds(),
- newBounds = new L.Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));
+ newBounds = new L.Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));
return offset.add(this._getBoundsOffset(newBounds, bounds));
},
+ // returns offset needed for pxBounds to get inside maxBounds at a specified zoom
_getBoundsOffset: function (pxBounds, maxBounds, zoom) {
var nwOffset = this.project(maxBounds.getNorthWest(), zoom).subtract(pxBounds.min),
seOffset = this.project(maxBounds.getSouthEast(), zoom).subtract(pxBounds.max),
--
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