View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Vector sources

Source guide Project README

Initializes GeoJSON and vector tile sources and manages source areas, feature preparation, loading queues and mesh attachment.

From view to mesh

flowchart LR
  View["Map view"] --> Areas["updateArea: retain / release"]
  Areas --> Queue["pump: nearest areas"]
  Queue --> Load["Load feature collection"]
  Load --> Style["Style + project features"]
  Style --> Worker["Worker: build geometry"]
  Worker --> Check{"Still wanted?"}
  Check -->|yes| Mesh["Attach mesh + schedule frame"]
  Check -->|no| Stop["Discard"]

GeoJSON uses one area; archive blocks include a view border. The pump allows four jobs per scene and two per layer. null styles skip features; metadata and face ranges support picking. Errors emit error; released areas abort work and destroy their buffers. Vector tiles have a separate lifecycle.

Related: scene, workers, vector-tiles.