Atlaslog
Atlaslog / Field Notes / MapLibre styles & layers
Field note · MapLibre styles & layers

Sprite 404s turn every POI icon into a blank square

Quick answer

The style's sprite field is a prefix that MapLibre expands into up to four files, and all of them 404, so road shields and station icons render as empty boxes while the rest of the map is fine.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: MapLibre GL JS
Symptom
Checklist
  1. Print map.getStyle().sprite to see the configured prefix.
  2. Fetch all four derived URLs and check their status codes.
  3. Open sprite.json and confirm each icon has x, y, width, height and pixelRatio.
  4. Check whether a relative sprite path resolves under /styles/basic/.
Fix

Set sprite to the prefix only, for example /sprites/sprite, generate all four files with spritezero (--ratio 2 for @2x), or add an Nginx fallback rewriting sprite@2x.* to the 1x files.

Code
GET /sprites/sprite.json 404 (Not Found)
GET /sprites/sprite.png 404 (Not Found)
GET /sprites/sprite@2x.json 404 (Not Found)
Error: Could not load sprite at /sprites/sprite.json
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). Sprite 404s turn every POI icon into a blank square. https://www.jingweizhi.com/en/cookbook/maplibre-sprite-missing.html (accessed 2026-11-03).