View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Animations

Source guide Project README

Schedules camera transitions, zoom synchronization, marker panning and grid tile fades. Shared queues allow multiple layers or maps to use the same animation frame.

Timing and cancellation

flowchart LR
  Camera["Camera target"] --> Cancel["Cancel previous animation"]
  Cancel --> Motion{"Animate?"}
  Motion -->|yes| Arc["Shortest bearing arc + frames"]
  Motion -->|no / reduced motion| Direct["Apply target"]
  Fade["Grid fade request"] --> Revision["Record layer revision"]
  Revision --> Frame["Shared animation frame"]
  Frame --> Current{"Revision current?"}
  Current -->|yes| Opacity["Update tile opacity"]
  Current -->|no| Ignore["Ignore stale entry"]

Zoom synchronization has its own intermediate view: synchronizeZoomView.js.

Related: camera, core, rendering.