AlgoViz

Make a map pan feel instant

medium 6 min

A transit map has a stable street network and vehicles that move every few seconds.

Video lesson · Chapter 1 of 5

One neighbourhood shows an old road

0:00 / 4:05

Move one bus without redrawing the city

1:11Reel

Theory

Read or listen first. About 1 min.

What it is

Street geometry can remain stable for weeks. A vehicle can move between two screen refreshes. A map combines these layers visually, but its storage and delivery paths can update them independently. Splitting them also lets a phone keep rendering streets while the live feed reconnects.

Move one bus or pan the viewport

Tile ATile BTile CViewport A + B · refresh the vehicle overlay
The vehicle moves along the blue route. Its small live overlay changes while the visible street tiles remain cached.

Why it exists

Tiles divide a view into reusable pieces at a chosen zoom level. Nearby users often request the same street tiles, which makes them good cache entries. Raster tiles contain rendered pixels. Vector tiles contain features the client can restyle, label and draw. The latter moves rendering work onto the device.

View diagram · Rendering a viewport
Street tile CDN → Tile cache (versioned tiles); Live vehicle feed → Live overlay (position deltas); Tile cache → Map view (streets); Live overlay → Map view (vehicles)
Versioned tile URLs allow a consistent rollout.
Full size

Words to know

Vector tile
Geometry and attributes for a region that the client can render with a style.
Delta cursor
A position from which a client can request newer updates.

How it works

Step through the idea, or press Play.

Step 1 of 3

Split by update rate. Publish street geometry as tiles indexed by zoom and coordinates. Serve the small live vehicle overlay separately so a delayed bus update cannot invalidate a city’s basemap.

Understand it

Start here

Follow a bus through a tiled map

Watch the bus icon and the street beneath it. First the vehicle moves, then the rider pans the viewport. Each action asks the map client for a different piece of data.

Follow a bus through a tiled map
A bus moves across a cached maproads v17Fetch the visible streets and one bus

A small vehicle delta can update the overlay.

Structure

Rendering a viewport

Rendering a viewport

Street tile CDN → Tile cache (versioned tiles); Live vehicle feed → Live overlay (position deltas); Tile cache → Map view (streets); Live overlay → Map view (vehicles)
Versioned tile URLs allow a consistent rollout.

A tile rollout

Publish roads version 18 while a phone is panning with version 17. Keep 17 available until clients have transitioned. A bus position arriving during the switch updates only the live layer. Test with the network disconnected between fetching the style and the next tile.

Two versions of a map

A rider pans east

EventFetchReuse
First view at zoom 14Visible street tiles and current vehiclesPreviously cached tiles of this generation
Pan by half a tileNewly exposed edge tilesTiles still on screen
Bus reports a positionVehicle deltaAll street geometry
New road dataset publishedManifest and newly referenced tilesPrior generation for existing readers

The cache key is a contract

A tile key usually includes dataset version, zoom, column and row. If pixels are rendered on the server, style and language may also change the bytes and belong in that cache identity. With client-side styling, a single geometry tile can serve multiple themes when its attributes support both. Check the entire dependency chain, including font and sprite versions.

Keep live updates recoverable

A cursor lets a reconnecting client request vehicle changes since its last view. If that cursor falls outside retention, fetch a fresh snapshot and resume deltas from its revision. Remove vehicles that leave the viewport or go stale. An otherwise accurate road layer can make an out-of-date vehicle icon look more trustworthy than it is.

Version streets independently

  • A small vehicle delta can update the overlay.

Bake live positions into street tiles

  • Every vehicle movement causes avoidable cache churn.

Summary

The whole topic in one minute.

Cache stable geography by version. Give moving objects a separate freshness contract and a recovery path after missed updates.

Sources