Skip to main content

Module map

Module map 

Expand description

Map: children laid out at points on a surface that pans and zooms, as a described component.

A canvas, a diagram, a map of devices: what the person arranged is where things are, in whole canvas pixels, and the view is the camera that looks at it. layout.md’s “no absolute positions” is about a view’s own layout; a canvas is placed content (shell.md §2), so its places are points and this widget is what draws them.

The camera is the widget’s own state, a lens: personal, kept on this device, never in the person’s arrangement. Panning and zooming move and scale the pins; a discrete change of the pins or of the camera lays them out again. At rest the map asks for no frames.

Each child is a MapPin: its key, its x and y in canvas pixels, its width, and the view it shows. The map changes nothing itself: the caller commits one arranging action when the person moves a place.

Structs§

Map
See the module docs.
MapCamera
The camera: which canvas point stands at the viewport’s top-leading corner, and how many screen pixels a canvas pixel takes.
MapPinProps
One pin of a map, as an instance gives it: its key, its place and the view it shows.
MapProps
Places at points on a pannable, zoomable surface, each a view of its own.
PinPlace
A pin’s place, in canvas pixels.

Constants§

MAP_ZOOM_MAX
MAP_ZOOM_MIN
The smallest and largest zoom the map is shown at: far enough out to see a whole canvas, far enough in to read a note.