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§
- Anchored
Momentum - How a gesture’s zoom, bearing or pitch keeps changing after release.
- 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
Limits - The limits a map’s camera moves within.
- 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. - Invalid
Momentum - Why a momentum setting is out of range.
- 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.
- 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.
- Momentum
Decay - 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.
- Momentum
Easing - A unit cubic Bézier, from (0, 0) to (1, 1), with these control points.
- Momentum
Glide - How one part glides after release: from
velocity, per second, bydecay. A pan’s decay applies to its speed. - Momentum
Snap - Where a part settles once its glide ends: 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. - Terrain
Options - How a map draws its terrain, for the map’s lifetime.
- Tile
Settings - How a map picks the tiles to load.
- Transform
State - A map’s camera with the limits that constrain it: the
Viewit shows now, and the bounds, zoom, pitch and field of view it may move within. - 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. - 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§
- Axonometric
Mode - Whether axonometric rendering is enabled.
- 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 - How a glide unfolds from its release speed.
- North
Orientation - Determines the orientation of the map.
- Render
Mode - Style
Load Error - Why a style failed to load.
- Terrain
Skirt Length - 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.
- 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.
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§
- 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.