Merge pull request #4337 from jieter/tilelayer-y

Support {-y} in tile layer urls (Fixes #4284)
This commit is contained in:
Iván Sánchez Ortega 2016-03-21 12:36:10 +01:00
commit b60e18d5c6

View File

@ -75,11 +75,14 @@ L.TileLayer = L.GridLayer.extend({
},
getTileUrl: function (coords) {
var invertedY = this._globalTileRange.max.y - coords.y;
return L.Util.template(this._url, L.extend({
r: L.Browser.retina ? '@2x' : '',
s: this._getSubdomain(coords),
x: coords.x,
y: this.options.tms ? this._globalTileRange.max.y - coords.y : coords.y,
y: this.options.tms ? invertedY : coords.y,
'-y': invertedY,
z: this._getZoomForUrl()
}, this.options));
},