View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Mapbox Vector Tiles

Source guide Project README

Decodes uncompressed MVT/PBF data into tile-local layers and provides polygon ring triangulation. Large integer values are preserved as decimal strings.

Tile-space decoding

flowchart LR
  Bytes["Uncompressed MVT bytes"] --> PBF["Read PBF fields / layers"]
  PBF --> Features["Tile-local features"]
  Features --> Rings["Group polygon rings"]
  Rings --> Triangulate["Shared triangulator"]
  Triangulate -->|"recognized failure"| Fallback["Even-odd tessellation"]
  Features --> Presentation["Style + project + display"]

Duplicate layer names are rejected. Integers outside JavaScript’s safe range are decimal strings, including possible IDs and properties. Presentation belongs to vector-tiles.

Related: vector-tiles, vector-style.