Skip to main content

Module loading_placeholder

Module loading_placeholder 

Source
Expand description

§Loading placeholders and skeleton rendering

When tiles are in the visible set but have no data yet, the engine emits LoadingPlaceholder descriptors so that renderers can draw styled rectangles at the tile’s world bounds instead of leaving blank gaps. This matches the Mapbox “skeleton chrome” loading experience.

§Data flow

VisibleTile { data: None }          PlaceholderStyle (per-source config)
         |                                    |
         +----> PlaceholderGenerator::generate +
                        |
                Vec<LoadingPlaceholder>
                        |
                   FrameOutput.placeholders
                        |
            +-----------+-----------+
            |                       |
     WGPU renderer           Bevy renderer
     (solid quad pass)       (entity sync)

§Animation

Each placeholder carries an animation_phase in [0.0, 1.0) that renderers can use to drive a pulsing opacity or horizontal shimmer effect. The phase is derived from a monotonic time value so that all placeholders pulse in sync regardless of spawn order.

§Style

PlaceholderStyle is a lightweight value-type that controls the visual appearance. It lives on MapState (and can be set via the style document) so that both Bevy and WGPU renderers see the same configuration.

Structs§

LoadingPlaceholder
A single loading-placeholder tile emitted for rendering.
PlaceholderGenerator
Builds LoadingPlaceholder entries from the current visible tile set.
PlaceholderStyle
Visual configuration for loading-placeholder tiles.