View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Vector styles

Source guide Project README

Parses and validates vector style layers, evaluates supported expressions and translates paint values for vector tile rendering.

Style input and evaluation

flowchart LR
  Text["JSON / otm_layers text"] --> Clean["Remove comments + trailing commas"]
  Clean --> Parse["JSON parse + validate layers"]
  Parse --> Match["Match style and source layers"]
  Match --> Evaluate["Evaluate expressions: properties + zoom"]
  Evaluate --> Paint["Resolve fill / line paint"]
  Paint --> Tile["Vector tile presentation"]

Parsing does not execute arbitrary JavaScript. Only supported expression operators are evaluated; non-array values pass through unchanged.

Related: vector-tiles, colors, mvt.