|
QGroundControl
Ground Control Station for MAVLink Drones
|
#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 |
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.
|
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.
| void TileImageSource::cancelRequest | ( | int | requestId | ) |
Cancel a pending request, aborting any in-flight network fetch.
Definition at line 114 of file TileImageSource.cc.
|
inline |
Definition at line 48 of file TileImageSource.h.
|
inline |
Definition at line 56 of file TileImageSource.h.
| int TileImageSource::requestTileImage | ( | const TileMath::TileKey & | key | ) |
Request the image for a tile. Returns a request id (> 0).
Definition at line 61 of file TileImageSource.cc.
References QGCMapEngine::addTask(), QGeoFileTileCacheQGC::createFetchTileTask(), QGCMapTask::error(), getQGCMapEngine(), QGCCacheTile::img, QGCFetchTileTask::tileFetched(), TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
|
signal |
Referenced by SurfacePatchModel::setMapType().
|
signal |
Referenced by SurfacePatchModel::setMapType().