Skip to content

five-on-it / apps/client/src/ui/map-labels

apps/client/src/ui/map-labels ​

The maps' words, drawn in a pass of their own over everything else at a fixed 12 CSS px whatever the map's size or the screen's pixel ratio (so they read on the corner map and on the full map alike), each with a dark halo: the districts' titles first, then the boxes the waypoint's and the mission's markers keep clear, then the streets' names (a road's name made readable, streetName: road-old-quay-2 is Old Quay, each name once, along the longest straight stretch of it that fits, kept upright), then the garages'. Every label is a box turned with its text; one that would overlap a label placed before it, or stick out of the map, is left out (declutter). Pure but for drawLabels, which writes the placed ones on a canvas.

Interfaces ​

Variables ​

Functions ​