Atlaslog
Atlaslog / OpenLayers / Tutorial / Performance: from thousands to hundreds of thousands
OpenLayers · Tutorial

Performance: from thousands to hundreds of thousands

Quick answer

This tutorial matches rendering strategy to feature count in OpenLayers, from a few hundred features to hundreds of thousands. It introduces ol.layer.WebGLPoints with declarative expressions such as interpolate and match, disables updateWhileAnimating and updateWhileInteracting, raises renderBuffer, and caches ol.style.Style objects by category. It also applies geometry simplification, bbox loading and ol.source.Cluster. Readers can find the real bottleneck and choose an approach that scales.

Last verified 2026-11-03 · OpenLayers 10.3.1 · Cite this page
Key points
Example
var pointsLayer = new ol.layer.WebGLPoints({
  source: new ol.source.Vector({
    url: '/data/stations.geojson',
    format: new ol.format.GeoJSON()
  }),
  style: {
    'circle-radius': [
      'interpolate', ['linear'], ['get', 'flow'],
      0, 3,
      500, 8,
      2000, 14
    ],
    'circle-fill-color': [
      'match', ['get', 'level'],
      'high', '#d0453a',
      'mid', '#f0a020',
      '#1f5fd0'
    ],
    'circle-opacity': 0.82,
    'circle-stroke-width': 1,
    'circle-stroke-color': '#ffffff'
  }
});

map.addLayer(pointsLayer);
var parcels = new ol.layer.Vector({
  source: parcelSource,
  updateWhileAnimating: false,
  updateWhileInteracting: false,
  declutter: false,
  style: cachedStyle
});
var map = new ol.Map({
  target: 'map',
  layers: [base, parcels],
  renderBuffer: 200,
  view: view
});
Notes
Runnable examplesChinese originalAll Tutorials
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Performance: from thousands to hundreds of thousands. https://www.jingweizhi.com/en/openlayers/tutorials/performance.html (accessed 2026-11-03).