Skip to content

fix: cap USGS maxZoom at 16 to match tile server capability - #709

Merged
brunob merged 1 commit into
leaflet-extras:masterfrom
simonyang08:fix/usgs-maxzoom
Sep 24, 2026
Merged

brunob merged 1 commit into
leaflet-extras:masterfrom
simonyang08:fix/usgs-maxzoom

Conversation

@simonyang08

Copy link
Copy Markdown

Fixes #570

Freshly verified against the live tile servers on 2026-09-17 (CONUS center, basemap.nationalmap.gov):

zoom USGSTopo USGSImageryOnly
8–12 200 200
16 200 200
17 404 404
20 404 —

Two findings versus the issue thread:

  1. The missing zoom levels 9–11 reported in February 2025 are fixed server-side — all three levels return real tiles now, so only the max-zoom cap remains broken.
  2. The server really stops at zoom 16: 17+ return 404 for both the Topo and Imagery services, while the provider definition advertises maxZoom: 20 for all three USGS variants. Users panning at zoom 17+ get empty grey areas.

This PR sets the shared parent maxZoom: 16, which covers all three variants (USTopo, USImagery, USImageryTopo) since they inherit it.

Note: if you would rather keep zooming closer with upscaled tiles, Leaflet's maxNativeZoom: 16 would do that — I kept it plain maxZoom because the file doesn't use maxNativeZoom anywhere today. Happy to switch if preferred.

The USGS national map tile endpoints (USGSTopo, USGSImageryOnly,
USGSImageryTopo) return 404 above zoom level 16. Verified on
2026-09-17: zooms 8-16 return HTTP 200 while 17 and above return
HTTP 404 for all three services, so the previous maxZoom of 20
produced missing-map areas for users who zoom past 16.

Fixes leaflet-extras#570
@brunob

brunob commented Sep 24, 2026

Copy link
Copy Markdown
Member

Thx for this one :)

@brunob
brunob merged commit 6839db7 into leaflet-extras:master Sep 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USGS basemaps seem to have max zoom of 16, not 20 as defined

3 participants