[Pkg-javascript-commits] [leaflet] 186/301: Generalized

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:50 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 8ae0e2700cbf907abc0d13531b1527f92d27241d
Author: perliedman <per.liedman at kartena.se>
Date:   Wed Nov 6 21:46:17 2013 +0100

    Generalized
---
 src/geo/crs/CRS.js          | 10 +++++-----
 src/layer/tile/TileLayer.js |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/geo/crs/CRS.js b/src/geo/crs/CRS.js
index f8ccbaa..a24a8b4 100644
--- a/src/geo/crs/CRS.js
+++ b/src/geo/crs/CRS.js
@@ -5,14 +5,14 @@
 L.CRS = {
 	latLngToPoint: function (latlng, zoom) { // (LatLng, Number) -> Point
 		var projectedPoint = this.projection.project(latlng),
-		    scale = this.scale(zoom);
+			scale = this.scale(zoom);
 
 		return this.transformation._transform(projectedPoint, scale);
 	},
 
 	pointToLatLng: function (point, zoom) { // (Point, Number[, Boolean]) -> LatLng
 		var scale = this.scale(zoom),
-		    untransformedPoint = this.transformation.untransform(point, scale);
+			untransformedPoint = this.transformation.untransform(point, scale);
 
 		return this.projection.unproject(untransformedPoint);
 	},
@@ -25,8 +25,8 @@ L.CRS = {
 		return 256 * Math.pow(2, zoom);
 	},
 
-	getBounds: function (zoom) {
+	getSize: function (zoom) {
 		var s = this.scale(zoom);
-		return [s, s, s, s];
-   	}
+		return L.point(s, s);
+	}
 };
diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js
index e60cee9..e0b13a2 100644
--- a/src/layer/tile/TileLayer.js
+++ b/src/layer/tile/TileLayer.js
@@ -474,8 +474,8 @@ L.TileLayer = L.Class.extend({
 
     _getWrapTileNum: function () {
 		var crs = this._map.options.crs,
-			bounds = crs.getBounds(this._getZoomForUrl());
-		return bounds[3] / this.options.tileSize;
+			size = crs.getSize(this._getZoomForUrl());
+		return size.divideBy(this.options.tileSize);
 	},
 
 	_adjustTilePoint: function (tilePoint) {
@@ -484,11 +484,11 @@ L.TileLayer = L.Class.extend({
 
 		// wrap tile coordinates
 		if (!this.options.continuousWorld && !this.options.noWrap) {
-			tilePoint.x = ((tilePoint.x % limit) + limit) % limit;
+			tilePoint.x = ((tilePoint.x % limit.x) + limit.x) % limit.x;
 		}
 
 		if (this.options.tms) {
-			tilePoint.y = limit - tilePoint.y - 1;
+			tilePoint.y = limit.y - tilePoint.y - 1;
 		}
 
 		tilePoint.z = this._getZoomForUrl();

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