Skip to main content

Crate mln_map

Crate mln_map 

Source
Expand description

The map: Map, its options, the transform that moves its camera, and the events it reports. The map vocabulary that lower crates need (CameraOptions, MapMode, TransformState, …) lives in mln_map_types and is re-exported here.

Re-exports§

pub use transform::CameraCommandId;
pub use transform::CommandEnd;
pub use transform::FrameClock;

Modules§

transform
The map’s camera: the commands, animations, gestures and momentum that move it within its limits.

Structs§

AnchoredMomentum
How a gesture’s zoom, bearing or pitch keeps changing after release.
AnimationOptions
Various options for describing a transition between viewpoints with animation. All fields are optional; the default values depend on how this struct is used.
BoundOptions
Holds options to limit what parts of a map are visible. All fields are optional.
Camera
A camera with every member set: the camera that a map has, where CameraOptions is a change to one.
CameraBounds
All the limits on a map’s camera.
CameraChange
A camera change: whether it jumps or animates, and what made it.
CameraDelta
A change to the camera from where it is now, as a gesture makes it (the C API’s mln_camera_delta).
CameraLimits
The limits a map’s camera moves within.
CameraMomentum
Camera motion that continues a gesture after its last contact lifts.
CameraOptions
Various options for describing the viewpoint of a map. All fields are optional. A partial command replaces animations of its specified fields. Omitted fields keep their original animation timing. Flights couple center and zoom; anchored commands couple center with their specified fields. Replacing any member of a coupled group stops that group. Anchor and center points are mutually exclusive, with preference for the center point when both are set.
CameraUpdate
Moves the camera to absolute values, as the C API’s mln_camera_update does: the counterpart of CameraDelta for commands and gestures that know where the camera should go.
CameraVelocity
How fast each part of a camera change moves, in its own unit per second.
Error
A failed call: its ErrorKind and a message that says what failed.
FreeCamera
A camera’s whole position and orientation in three dimensions.
FreeCameraOptions
Various options for accessing physical properties of the underlying camera entity. A direct access to these properties allows more flexible and precise controlling of the camera while also being fully compatible and interchangeable with CameraOptions. All fields are optional.
InvalidMomentum
Why a momentum setting is out of range.
LogicalExtent
A size in logical pixels, and the physical pixels in each logical pixel.
Map
A map: its style, its camera, and the updates it publishes for its renderer.
MapOptions
How a map renders and lays itself out.
MapProjection
Converts coordinates for one camera and size, without a map: on the ground a renderer drew of a terrain (with_ground), or else on the flat map. It holds only a transform state and the ground, so it can move to another thread.
MapSnapshot
A map’s state at one moment.
MapView
One view of a map: its camera, size, and projection.
MomentumDecay
How one part of a release glides, in the part’s unit: logical pixels for pan, zoom levels for zoom, and degrees for bearing and pitch, with speeds per second.
MomentumEasing
A unit cubic Bézier, from (0, 0) to (1, 1), with these control points.
MomentumGlide
How one part glides after release: from velocity, per second, by decay. A pan’s decay applies to its speed.
MomentumSnap
Where a part settles once its glide ends: on the nearest of the targets every spacing from offset, when it is within tolerance of one. Bearing targets lie within one turn from offset, and the bearing takes the shorter way around to the nearest.
OverscaledTileID
Has integer z/x/y coordinates. overscaled_z describes the zoom level this tile is intended to represent, e.g. when parsing data. z is never larger than the source’s maxzoom.
ProjectionMode
Holds values for Axonometric rendering. All fields are optional.
RenderFrameStatus
RenderingStats
Counters of the rendering backend. The num_* and mem_* counters of buffers, textures and frame buffers count the live resources; total_*, *_updates and *_bytes grow over the context’s life.
TerrainOptions
How a map draws its terrain, for the map’s lifetime.
TileSettings
How a map picks the tiles to load.
TransformState
A map’s camera with the limits that constrain it: the View it shows now, and the bounds, zoom, pitch and field of view it may move within.
TransitionEnd
How a camera command ended, once every field of it has: completed, cancelled, replaced by later commands, or closed with the map. Other commands may still be animating. It replaces C++’s transitionFinishFn, which can’t tell those apart; the C API reports the same outcomes.
Update
An update that a slot published.
UpdateReader
The reading side of an UpdateSlot, for the renderer that draws the map. Clones read the same slot, each with a waker of its own.
View
One view of a map: its camera, size and projection, and the matrices it draws with. A view never changes: a map that moves its camera makes a new one.
Viewport
How a map orients and constrains its view.

Enums§

AxonometricMode
Whether axonometric rendering is enabled.
CameraChangeMode
CameraChangeSource
What moved the camera, as the C API’s mln_camera_change_source reports it.
CameraError
Why a CameraDelta was rejected.
CameraUpdateMode
How CameraUpdate moves the camera.
ConstrainMode
We can choose to constrain the map both horizontally or vertically, only vertically e.g. while panning, or screen to the specified bounds.
ErrorKind
What went wrong, as a caller would react to it.
GesturePhase
Where a camera change stands in a gesture, as the C API’s mln_gesture_phase defines it. Begin and Update mark a gesture in progress, and End and Cancel end it; a gesture whose end starts momentum stays in progress until the momentum ends.
MapEvent
An event of a map. The variants match the C API’s mln_runtime_event_type values for maps.
MapMode
MomentumDecayModel
How a glide unfolds from its release speed.
NorthOrientation
Determines the orientation of the map.
RenderMode
StyleLoadError
Why a style failed to load.
TerrainSkirtLength
How far the skirts that hang from the edges of terrain tiles reach down. Skirts hide the cracks where the edges of neighboring tiles don’t meet, and show through where the layers draped over the terrain are translucent.
TileLodMode
TileOperation
TransitionOutcome
How a camera command ended, as the C API’s mln_camera_transition_outcome reports it. A command that ended in more than one way reports Cancelled if any of it was cancelled, otherwise Closed if any of it was closed, and otherwise Replaced if any of it was replaced.
ViewportMode
Satisfies embedding platforms that requires the viewport coordinate systems to be set according to its standards.

Traits§

Elevation
The ground of a terrain as a frame drew it, which the map’s camera stands on. A renderer makes it and hands it to the map; it doesn’t change once made, so the map reads it on its own thread.

Functions§

style_camera
The camera options of style’s default camera, which the map jumps to once the style loads, unless a camera command came first.

Type Aliases§

RendererEvents
The queue a renderer pushes its events to.
Waker
Tells the owner of a queue that the queue has events to take. It runs on the thread that pushed the event, so it must not take the events itself there: it schedules the owner to do it, as by posting to its Queue.