QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TileImageSource Class Reference

#include <TileImageSource.h>

+ Inheritance diagram for TileImageSource:
+ Collaboration diagram for TileImageSource:

Signals

void tileImageReady (int requestId, const QImage &image)
 
void tileImageFailed (int requestId)
 

Public Member Functions

 TileImageSource (const QString &mapType, QObject *parent=nullptr, QNetworkAccessManager *networkManager=nullptr)
 
QString mapType () const
 
int requestTileImage (const TileMath::TileKey &key)
 Request the image for a tile. Returns a request id (> 0).
 
void cancelRequest (int requestId)
 Cancel a pending request, aborting any in-flight network fetch.
 
int pendingCount () const
 

Detailed Description

Async cache-first source of map tile images for draping onto surface patches.

Thin adapter over QGC's existing map tile infrastructure: tile requests hit the shared tile cache database first, fall back to a provider network fetch on miss (URL/headers from the provider registry), and store fetched tiles back into the cache. Patches are slippy-tile addressed, so one request maps to exactly one provider tile.

Results are always delivered asynchronously. No signal is emitted for a cancelled request. No internal retries: a failed request stays failed, and consumers re-request on their own cadence (patch eviction and re-add).

Definition at line 35 of file TileImageSource.h.

Constructor & Destructor Documentation

◆ TileImageSource()

TileImageSource::TileImageSource ( const QString &  mapType,
QObject *  parent = nullptr,
QNetworkAccessManager *  networkManager = nullptr 
)
explicit

mapType is a provider type string from UrlFactory::getProviderTypes() (e.g. "Google Satellite"). With an unknown type every request fails (asynchronously) without touching the cache or network. networkManager overrides the internally created one (test injection seam); an injected manager is not owned and must outlive this object

Definition at line 50 of file TileImageSource.cc.

Member Function Documentation

◆ cancelRequest()

void TileImageSource::cancelRequest ( int  requestId)

Cancel a pending request, aborting any in-flight network fetch.

Definition at line 114 of file TileImageSource.cc.

◆ mapType()

QString TileImageSource::mapType ( ) const
inline

Definition at line 48 of file TileImageSource.h.

◆ pendingCount()

int TileImageSource::pendingCount ( ) const
inline

Definition at line 56 of file TileImageSource.h.

◆ requestTileImage()

int TileImageSource::requestTileImage ( const TileMath::TileKey key)

◆ tileImageFailed

void TileImageSource::tileImageFailed ( int  requestId)
signal

◆ tileImageReady

void TileImageSource::tileImageReady ( int  requestId,
const QImage &  image 
)
signal

The documentation for this class was generated from the following files: