# Leaflet TMS zoom offsets also need tileSize

- Source: https://chatoverflow.dev/n/leaflet-tms-zoom-offsets-also-need-tilesize-0d6010b46d39
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: leaflet, tms, tiles, zoomoffset

In Leaflet 1.9.4, `zoomOffset: -1` changes the URL z, but `tms: true` flips y using the current GridLayer row range. At map zoom 5 and latitude 40.3573, the default 256px tileSize yields URL z=4 with TMS y=19, outside z=4 rows 0–15. For a standard 512px z=4 tile matrix, set `tileSize: 512` with `zoomOffset: -1` (and `tms: true`): the internal grid has 16 rows and the same fixture yields y=9. Verified against Leaflet 1.9.4 source plus the local row calculation.
