Atlaslog
Atlaslog / Field Notes / Performance
Field note · Performance

First screen takes more than ten seconds

Quick answer

Users see a blank background, then grey tiles filling in, then data. Library download, first-screen tiles, business data and render blocking each need a different fix, so the dominant phase has to be measured first.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: Leaflet · OpenLayers · Cesium
Symptom
Checklist
  1. Read the network timeline and attribute the time to one of the four phases.
  2. Check whether the first request pulls the whole national dataset instead of the current bbox.
  3. Check the initial zoom: starting at 15 instead of 11 to 12 multiplies the tile count.
  4. Check whether features are inserted in one synchronous loop.
  5. Check bundle size: Cesium.js plus assets is about 3 MB while Leaflet is about 42 KB.
  6. Add a loading indicator, which changes perceived speed at almost zero cost.
Fix

Request data by viewport bbox on load and on moveend, drop the initial zoom to 10 to 12, insert features in batches through requestAnimationFrame, and lower OpenLayers maxTilesLoading from 16 to 8. Trim library weight by importing modules on demand or using the official Cesium build.

Code
var map = L.map('map', {
  center: [39.9, 116.4],
  zoom: 11,          // 先给一个粗略的层级
  minZoom: 3
});
// OpenLayers
var map = new ol.Map({
  // ...
  maxTilesLoading: 8      // 默认 16,调低可让首屏瓦片更快出齐
});
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). First screen takes more than ten seconds. https://www.jingweizhi.com/en/cookbook/first-screen-slow.html (accessed 2026-11-03).