Incorrect tile search for option tms=true.
this._globalTileRange is not updated with subsequent calls to getTileUrl, so it looks for y values that are out of range.
Following Leaflet's _resetGrid function, getTileUrl probably needs to get the bounds for the new zoom layer. So something like this:
getTileUrl: function (coords) {
var z = coords.z = coords.fallback ? coords.z : this._getZoomForUrl();
var data = {
r: L.Browser.retina ? '@2x' : '',
s: this._getSubdomain(coords),
x: coords.x,
y: coords.y,
z: z
};
if (this._map && !this._map.options.crs.infinite) {
// these lines are new
var bounds = this._map.getPixelWorldBounds(z); // get bounds
if (bounds) {
var _globalTileRange = this._pxBoundsToTileRange(bounds); // update tile range
var invertedY = _globalTileRange.max.y - coords.y;
if (this.options.tms) {
data['y'] = invertedY;
}
data['-y'] = invertedY;
}
}
return L.Util.template(this._url, L.extend(data, this.options));
}
Incorrect tile search for option
tms=true.this._globalTileRangeis not updated with subsequent calls togetTileUrl, so it looks for y values that are out of range.Following Leaflet's
_resetGridfunction,getTileUrlprobably needs to get the bounds for the new zoom layer. So something like this: