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§
Structs§
- Animation
Options - Various options for describing a transition between viewpoints with animation. All fields are optional; the default values depend on how this struct is used.
- Bound
Options - 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
CameraOptionsis a change to one. - Camera
Bounds - All the limits on a map’s camera.
- Camera
Change - A camera change: whether it jumps or animates, and what made it.
- Camera
Delta - A change to the camera from where it is now, as a gesture makes it
(the C API’s
mln_camera_delta). - Camera
Momentum - Camera motion that continues a gesture after its last contact lifts.
- Camera
Options - 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.
- Camera
Update - Moves the camera to absolute values, as the C API’s
mln_camera_updatedoes: the counterpart ofCameraDeltafor commands and gestures that know where the camera should go. - Camera
Velocity - How fast each part of a camera change moves, in its own unit per second.
- Error
- A failed call: its
ErrorKindand a message that says what failed. - Free
Camera - A camera’s whole position and orientation in three dimensions.
- Free
Camera Options - 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. - Logical
Extent - 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.
- MapDebug
Options - The map’s debug overlays, a bit set. Where C++ tests a flag with
lhs & rhs, which returns a bool there, usecontains. - MapOptions
- How a map renders and lays itself out.
- MapProjection
- Converts coordinates for one camera and size, without a map. It holds only a transform state, 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.
- Momentum
Decay - How one part of a momentum slows from its release speed.
- Momentum
Easing - A unit cubic Bézier, from (0, 0) to (1, 1), with these control points.
- Momentum
Snap - Where a part settles once its glide ends normally: on the nearest of the
targets every
spacingfromoffset, when it is withintoleranceof one. Bearing targets lie within one turn fromoffset, and the bearing takes the shorter way around to the nearest. - Overscaled
TileID - Has integer z/x/y coordinates.
overscaled_zdescribes the zoom level this tile is intended to represent, e.g. when parsing data. z is never larger than the source’s maxzoom. - Projection
Mode - Holds values for Axonometric rendering. All fields are optional.
- Render
Frame Status - Rendering
Stats - Counters of the rendering backend. The
num_*andmem_*counters of buffers, textures and frame buffers count the live resources;total_*,*_updatesand*_bytesgrow over the context’s life. - Tile
Settings - How a map picks the tiles to load.
- Transform
State - Transition
End - 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.
- Update
Reader - 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. - Viewport
- How a map orients and constrains its view.
Enums§
- Camera
Change Mode - Camera
Change Source - What moved the camera, as the C API’s
mln_camera_change_sourcereports it. - Camera
Error - Why a
CameraDeltawas rejected. - Camera
Update Mode - How
CameraUpdatemoves the camera. - Constrain
Mode - We can choose to constrain the map both horizontally or vertically, only vertically e.g. while panning, or screen to the specified bounds.
- Error
Kind - What went wrong, as a caller would react to it.
- Gesture
Phase - Where a camera change stands in a gesture, as the C API’s
mln_gesture_phasedefines it.BeginandUpdatemark a gesture in progress, andEndandCancelend 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_typevalues for maps. - MapMode
- Momentum
Decay Model - North
Orientation - Determines the orientation of the map.
- Render
Mode - Style
Load Error - Why a style failed to load.
- Tile
LodMode - Tile
Operation - Transition
Outcome - How a camera command ended, as the C API’s
mln_camera_transition_outcomereports it. A command that ended in more than one way reportsCancelledif any of it was cancelled, otherwiseClosedif any of it was closed, and otherwiseReplacedif any of it was replaced. - Viewport
Mode - Satisfies embedding platforms that requires the viewport coordinate systems to be set according to its standards.
Type Aliases§
- Renderer
Events - 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.