TileLayer rounds fractional zoom in url to integer {z} (#8613)

Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
Ray Chan
2025-03-02 04:54:26 +08:00
committed by GitHub
parent 145a7a14da
commit 511f8f11e7
2 changed files with 27 additions and 3 deletions

View File

@ -224,8 +224,8 @@ export const TileLayer = GridLayer.extend({
_getZoomForUrl() {
let zoom = this._tileZoom;
const maxZoom = this.options.maxZoom,
zoomReverse = this.options.zoomReverse,
zoomOffset = this.options.zoomOffset;
zoomReverse = this.options.zoomReverse,
zoomOffset = this.options.zoomOffset;
if (zoomReverse) {
zoom = maxZoom - zoom;
@ -281,6 +281,10 @@ export const TileLayer = GridLayer.extend({
}
return GridLayer.prototype._tileReady.call(this, coords, err, tile);
},
_clampZoom(zoom) {
return Math.round(GridLayer.prototype._clampZoom.call(this, zoom));
}
});