Problem
When the map view changes rapidly (via zoom or pan), Galileo continues processing tile requests for tiles that are no longer visible. This causes:
- Request queue flooding - Rapid zoom operations queue many tile requests that become stale immediately
- Wasted resources - CPU/network cycles spent loading tiles that won't be displayed
- Delayed visible tiles - Currently-visible tiles wait behind stale requests in the queue
Current Behavior
Once a tile is requested through VectorTileProvider / ThreadVtProcessor, the request runs to completion even if the tile is no longer in the viewport. There's no mechanism to cancel or deprioritize stale requests.
Workaround
We've had to reduce zoom speed significantly to prevent queue backup:
// Reduced zoom speed (0.02) to prevent tile request queue flooding
// when zooming rapidly - Galileo doesn't cancel stale tile requests
let controller_config = MapControllerConfiguration::default().with_zoom_speed(0.02);
This trades off user experience (sluggish zoom) for stability.
Proposed Solution
Add support for request cancellation, potentially via:
- Cancellation tokens - Pass a token to VectorTileLoader::load() that can signal cancellation
- Request priority/invalidation - Allow marking requests as stale so the processor can skip them
- View-change callback - Notify the tile provider when the view changes so it can clear pending requests
Example API sketch:
// Option 1: Cancellation token
async fn load(&self, index: TileIndex, cancel: CancellationToken) -> Result<...>
// Option 2: Request handle that can be cancelled
let handle = provider.request_tile(index);
handle.cancel(); // Called when view changes
Use Case
We're building an embedded map application on Raspberry Pi where resources are constrained. The inability to cancel stale requests causes noticeable lag during navigation and zoom operations, especially when loading from network sources.
Problem
When the map view changes rapidly (via zoom or pan), Galileo continues processing tile requests for tiles that are no longer visible. This causes:
Current Behavior
Once a tile is requested through VectorTileProvider / ThreadVtProcessor, the request runs to completion even if the tile is no longer in the viewport. There's no mechanism to cancel or deprioritize stale requests.
Workaround
We've had to reduce zoom speed significantly to prevent queue backup:
This trades off user experience (sluggish zoom) for stability.
Proposed Solution
Add support for request cancellation, potentially via:
Example API sketch:
Use Case
We're building an embedded map application on Raspberry Pi where resources are constrained. The inability to cancel stale requests causes noticeable lag during navigation and zoom operations, especially when loading from network sources.