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

addLayer succeeds but nothing appears on the map

Quick answer

getLayer returns the layer object and no error is raised, yet no geometry renders because the filter, minzoom, visibility or layer order excludes it. A missing source name instead surfaces as Source not found.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: MapLibre GL JS
Symptom
Checklist
  1. Print map.getSource('poi'), getLayer('poi'), getLayoutProperty visibility and getFilter.
  2. Call querySourceFeatures to separate no data from no style.
  3. Set the filter to null and see whether features appear.
  4. Check minzoom against map.getZoom() and whether an opaque fill layer covers the layer.
Fix

Add the source and layer inside load with layout: { visibility: 'visible' }, place it above the fill layers with map.moveLayer('poi-circle'), and loosen the filter before tightening it.

Code
Error: Source "poi" not found
    at Style.addLayer (style.ts:1204)
console.log('source', map.getSource('poi'));
console.log('layer', map.getLayer('poi'));
console.log('visibility', map.getLayoutProperty('poi', 'visibility'));
console.log('filter', map.getFilter('poi'));
console.log('zoom', map.getZoom());
console.log('source features', map.querySourceFeatures('poi').length);
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). addLayer succeeds but nothing appears on the map. https://www.jingweizhi.com/en/cookbook/maplibre-layer-not-show.html (accessed 2026-11-03).