Skip to content

Commit

Permalink
Generalized
Browse files Browse the repository at this point in the history
  • Loading branch information
perliedman committed Nov 6, 2013
1 parent 2a407b1 commit 8ae0e27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/geo/crs/CRS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand All @@ -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);
}
};
8 changes: 4 additions & 4 deletions src/layer/tile/TileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit 8ae0e27

Please sign in to comment.