Handle tile availaibility at zoom levels #44
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gtfs.zone/coloring-book#44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the user zooms in past the max tile zoom for a basemap (most visibly with Esri satellite imagery, which tops out around zoom 19 in most areas), MapLibre requests tiles that don't exist and the map goes blank or shows grey tiles. The fix is to add
maxzoomto each raster source definition so MapLibre knows to overzoom-scale the highest available tile rather than requesting nonexistent ones. This is a one-line change per source with well-known values for each provider.We also change the satellite button icon from a globe to a tree, since the globe SVG is already used by the projection toggle button and having two globe icons in the basemap control is confusing.
Relevant context
src/modules/basemap-styles.ts— defines all sixBasemapStyleentries with their MapLibre style specs. Each has a single raster source. Themaxzoomproperty on a raster source tells MapLibre "use overzoom past this level" — it will render higher zooms using scaled-up tiles frommaxzoom, not blank tiles.src/modules/map-controller.tslines 218–237 — the initial OSM style defined inline during map construction also lacksmaxzoom. This is what renders on first load before any basemap switch.src/modules/basemap-control.tsline 42 — the satellite entry'siconfield is the globe SVG, which conflicts with the projection toggle's globe icon (line 196).maxzoomvalues by provider:tile.openstreetmap.org)Phase 1: Add maxzoom to all raster sources + change satellite icon
Goal: Fix the blank-tile problem for all basemaps and fix the icon ambiguity in one pass, since both changes touch
basemap-styles.ts.src/modules/basemap-styles.ts, addmaxzoomto each raster source:standardOSM source:maxzoom: 19satelliteEsri source:maxzoom: 19stamen-lightStadia source:maxzoom: 20stamen-darkStadia source:maxzoom: 20stamen-watercolorStadia source:maxzoom: 16topoEsri source:maxzoom: 19src/modules/basemap-styles.ts, replace the satellite entry'siconglobe SVG with a tree SVG (Heroicons outline style,class="w-6 h-6",stroke-width="1.5"):src/modules/map-controller.ts(the inline initial style, lines ~221–226), addmaxzoom: 19to the OSM source.Gotcha:
maxzoomon a raster source is distinct frommaxzoomon a layer. Set it on the source object (sources.osm,sources.satellite, etc.), not on the layer entry.Original Issue
Tiles are not available when you zoom in too tight with satellite. We should handle the problem better.