Merge pull request #1400 from jfirebaugh/getTileUrl
Enable cleaner overriding of TileLayer#getTileUrl
This commit is contained in:
commit
f12e7e65f3
@ -48,8 +48,6 @@ L.TileLayer.WMS = L.TileLayer.extend({
|
||||
|
||||
getTileUrl: function (tilePoint, zoom) { // (Point, Number) -> String
|
||||
|
||||
this._adjustTilePoint(tilePoint);
|
||||
|
||||
var map = this._map,
|
||||
crs = map.options.crs,
|
||||
tileSize = this.options.tileSize,
|
||||
|
@ -424,11 +424,9 @@ L.TileLayer = L.Class.extend({
|
||||
// image-specific code (override to implement e.g. Canvas or SVG tile layer)
|
||||
|
||||
getTileUrl: function (tilePoint) {
|
||||
this._adjustTilePoint(tilePoint);
|
||||
|
||||
return L.Util.template(this._url, L.extend({
|
||||
s: this._getSubdomain(tilePoint),
|
||||
z: this._getZoomForUrl(),
|
||||
z: tilePoint.z,
|
||||
x: tilePoint.x,
|
||||
y: tilePoint.y
|
||||
}, this.options));
|
||||
@ -451,6 +449,8 @@ L.TileLayer = L.Class.extend({
|
||||
if (this.options.tms) {
|
||||
tilePoint.y = limit - tilePoint.y - 1;
|
||||
}
|
||||
|
||||
tilePoint.z = this._getZoomForUrl();
|
||||
},
|
||||
|
||||
_getSubdomain: function (tilePoint) {
|
||||
@ -491,6 +491,7 @@ L.TileLayer = L.Class.extend({
|
||||
tile.onload = this._tileOnLoad;
|
||||
tile.onerror = this._tileOnError;
|
||||
|
||||
this._adjustTilePoint(tilePoint);
|
||||
tile.src = this.getTileUrl(tilePoint);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user