Support {-y} in tile layer urls (Fixes #4284)

This commit is contained in:
Jan Pieter Waagmeester 2016-03-21 11:51:24 +01:00
parent 8e2e790933
commit d5e78e2253

View File

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