Skip to content

Commit

Permalink
Merge pull request #44 from icetan/tms-zoom-fix
Browse files Browse the repository at this point in the history
Added zoom parameter to L.Proj.TileLayer.TMS.prototype.getTileUrl
  • Loading branch information
Per Liedman committed Oct 25, 2013
2 parents 1f6f4d1 + 2d769c9 commit 827deff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/proj4leaflet.js
Expand Up @@ -173,14 +173,15 @@ L.Proj.TileLayer.TMS = L.TileLayer.extend({
}
},

getTileUrl: function(tilePoint) {
// TODO: relies on some of TileLayer's internals
var z = this._getZoomForUrl(),
gridHeight = Math.ceil((this.crs.projectedBounds[3] - this.crs.projectedBounds[1]) / this._projectedTileSize(z));
getTileUrl: function(tilePoint, zoom) {
var gridHeight = Math.ceil(
(this.crs.projectedBounds[3] - this.crs.projectedBounds[1]) /
this._projectedTileSize(zoom)
);

return L.Util.template(this._url, L.Util.extend({
s: this._getSubdomain(tilePoint),
z: z,
z: zoom,
x: tilePoint.x,
y: gridHeight - tilePoint.y - 1
}, this.options));
Expand Down

0 comments on commit 827deff

Please sign in to comment.