<< All versions
Skill v1.0.0
currentAutomated scan100/100kendrick-oppong/geoskills/webgis-performance-optimization
──Details
PublishedOctober 24, 2026 at 10:48 PM
Content Hashsha256:4bc3c5cd20dbbdee...
Git SHAfe4762133b94
──Files
Files (1 file, 4.5 KB)
SKILL.md4.5 KBactive
SKILL.md · 64 lines · 4.5 KB
version: "1.0.0" name: webgis-performance-optimization description: Use when a web map is slow, janky, or memory-heavy — client-side rendering performance, tile/data loading strategy, clustering, simplification, LOD, web workers, and memory leak patterns specific to interactive maps.
WebGIS Performance Optimization
When to use this skill
- "The map is laggy / freezes / crashes the tab on large data"
- Diagnosing slow pan/zoom, slow initial load, or memory growth over a long session
- Deciding between clustering, simplification, tiling, or aggregation for a given dataset size
Diagnostic framework — find the actual bottleneck first
| Symptom | Likely cause | Fix direction | |
|---|---|---|---|
| Slow initial load, fast after | Oversized single payload (huge GeoJSON) | Switch to vector tiles / FlatGeobuf / paginated fetch | |
| Janky pan/zoom with many markers | Too many DOM/SVG elements (Leaflet default markers at scale) | Cluster (supercluster), switch to canvas/WebGL rendering, or deck.gl | |
| Slow only at low zoom / continent view | Rendering full-detail geometry at a scale where it can't be perceived | Simplify geometry per zoom level (server-side, e.g. via tippecanoe's -simplification, or mapshaper) | |
| Memory grows over a long session, never freed | Event listeners / map layers not cleaned up on navigation/unmount | Audit map.remove()/listener cleanup in component teardown | |
| Slow attribute-heavy popups/tooltips | Fetching full feature detail on every hover | Fetch minimal tile-embedded properties; lazy-load full detail only on click | |
| Slow spatial filtering (e.g. "features within viewport") | Filtering done in JS over the full in-memory dataset per frame | Push filtering to the backend/tile source, or index client-side with a quadtree/rbush |
Checklist
- [ ] Is data delivered as vector tiles (or otherwise tiled/paginated) rather than one large GeoJSON blob, once feature count exceeds roughly 10-50k?
- [ ] Are point clusters used at low zoom instead of rendering every individual marker (Leaflet:
Leaflet.markercluster/supercluster; MapLibre: cluster option on GeoJSON source; deck.gl: aggregation layers)? - [ ] Is geometry simplified appropriately per zoom level rather than shipping full-precision polygons to a zoomed-out view?
- [ ] Are expensive computations (clustering, spatial joins, simplification) offloaded to a Web Worker so the main thread/UI stays responsive?
- [ ] Is the map instance and all its listeners properly torn down on component unmount/route change (React
useEffectcleanup, AngularngOnDestroy) — a very common SPA memory-leak source? - [ ] Are raster tiles cached (browser HTTP cache headers, or a service worker) to avoid re-fetching on repeated pan-backs?
- [ ] For frequently-updating real-time data (live tracking), is the update strategy patching only changed features rather than replacing the entire dataset/layer each tick?
Common pitfalls
- Leaflet with thousands of individual DOM markers: each marker is a DOM node; beyond a few thousand this degrades badly — cluster or switch rendering strategy (canvas renderer, or a different engine per
webgis-engine-selection). - Sending full-resolution GeoJSON regardless of zoom: forces the browser to parse and render orders of magnitude more vertices than are visually distinguishable at that zoom — always pair delivery format with zoom-aware simplification.
- Recomputing derived data (clusters, aggregates) synchronously on every map `move`/`zoom` event on the main thread: causes visible jank; debounce/throttle these handlers and consider workers for heavy computation.
- Not memoizing layer/source definitions in React, causing the map library to tear down and recreate layers every render instead of diffing efficiently.
- Loading an entire real-time feed's full history into the map on every update instead of maintaining an incremental in-memory state and only diffing/patching what changed.
Reference snippets
javascript
// MapLibre: built-in clustering on a GeoJSON sourcemap.addSource('points', {type: 'geojson', data: geojson,cluster: true, clusterMaxZoom: 14, clusterRadius: 50,});
bash
# Simplify + tile with zoom-aware detail reduction (tippecanoe)tippecanoe -o output.mbtiles -z14 -Z0 --drop-densest-as-needed input.geojson
Related skills
vector-tile-pipeline— the tiling/simplification pipeline referenced abovedeckgl-large-scale-viz— GPU-based rendering strategy for very large datasetsrealtime-geospatial-tracking— incremental update strategy for live data feeds