Commit eb0b6c05 authored by Don Gagne's avatar Don Gagne

parent afc5c2c9
...@@ -78,19 +78,19 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1, ...@@ -78,19 +78,19 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1,
_bottomRightLon = lon1; _bottomRightLon = lon1;
_minZoom = minZoom; _minZoom = minZoom;
_maxZoom = maxZoom; _maxZoom = maxZoom;
_totalSet.clear();
_imageSet.clear();
_elevationSet.clear();
for(int z = minZoom; z <= maxZoom; z++) { for(int z = minZoom; z <= maxZoom; z++) {
QGCTileSet set = QGCMapEngine::getTileCount(z, lon0, lat0, lon1, lat1, mapType); QGCTileSet set = QGCMapEngine::getTileCount(z, lon0, lat0, lon1, lat1, mapType);
_totalSet += set; _imageSet += set;
} }
if (_fetchElevation) { if (_fetchElevation) {
QGCTileSet set = QGCMapEngine::getTileCount(1, lon0, lat0, lon1, lat1, UrlFactory::AirmapElevation); QGCTileSet set = QGCMapEngine::getTileCount(1, lon0, lat0, lon1, lat1, UrlFactory::AirmapElevation);
_totalSet += set; _elevationSet += set;
} }
emit tileX0Changed();
emit tileX1Changed();
emit tileY0Changed();
emit tileY1Changed();
emit tileCountChanged(); emit tileCountChanged();
emit tileSizeChanged(); emit tileSizeChanged();
...@@ -101,14 +101,14 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1, ...@@ -101,14 +101,14 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1,
QString QString
QGCMapEngineManager::tileCountStr() QGCMapEngineManager::tileCountStr()
{ {
return QGCMapEngine::numberToString(_totalSet.tileCount); return QGCMapEngine::numberToString(_imageSet.tileCount + _elevationSet.tileCount);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
QString QString
QGCMapEngineManager::tileSizeStr() QGCMapEngineManager::tileSizeStr()
{ {
return QGCMapEngine::bigSizeToString(_totalSet.tileSize); return QGCMapEngine::bigSizeToString(_imageSet.tileSize + _elevationSet.tileSize);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -142,7 +142,7 @@ QGCMapEngineManager::_tileSetFetched(QGCCachedTileSet* tileSet) ...@@ -142,7 +142,7 @@ QGCMapEngineManager::_tileSetFetched(QGCCachedTileSet* tileSet)
void void
QGCMapEngineManager::startDownload(const QString& name, const QString& mapType) QGCMapEngineManager::startDownload(const QString& name, const QString& mapType)
{ {
if(_totalSet.tileSize) { if(_imageSet.tileSize) {
QGCCachedTileSet* set = new QGCCachedTileSet(name); QGCCachedTileSet* set = new QGCCachedTileSet(name);
set->setMapTypeStr(mapType); set->setMapTypeStr(mapType);
set->setTopleftLat(_topleftLat); set->setTopleftLat(_topleftLat);
...@@ -151,8 +151,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType) ...@@ -151,8 +151,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType)
set->setBottomRightLon(_bottomRightLon); set->setBottomRightLon(_bottomRightLon);
set->setMinZoom(_minZoom); set->setMinZoom(_minZoom);
set->setMaxZoom(_maxZoom); set->setMaxZoom(_maxZoom);
set->setTotalTileSize(_totalSet.tileSize); set->setTotalTileSize(_imageSet.tileSize);
set->setTotalTileCount(_totalSet.tileCount); set->setTotalTileCount(_imageSet.tileCount);
set->setType(QGCMapEngine::getTypeFromName(mapType)); set->setType(QGCMapEngine::getTypeFromName(mapType));
QGCCreateTileSetTask* task = new QGCCreateTileSetTask(set); QGCCreateTileSetTask* task = new QGCCreateTileSetTask(set);
//-- Create Tile Set (it will also create a list of tiles to download) //-- Create Tile Set (it will also create a list of tiles to download)
...@@ -171,8 +171,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType) ...@@ -171,8 +171,8 @@ QGCMapEngineManager::startDownload(const QString& name, const QString& mapType)
set->setBottomRightLon(_bottomRightLon); set->setBottomRightLon(_bottomRightLon);
set->setMinZoom(1); set->setMinZoom(1);
set->setMaxZoom(1); set->setMaxZoom(1);
set->setTotalTileSize(_totalSet.tileSize); set->setTotalTileSize(_elevationSet.tileSize);
set->setTotalTileCount(_totalSet.tileCount); set->setTotalTileCount(_elevationSet.tileCount);
set->setType(QGCMapEngine::getTypeFromName("Airmap Elevation Data")); set->setType(QGCMapEngine::getTypeFromName("Airmap Elevation Data"));
QGCCreateTileSetTask* task = new QGCCreateTileSetTask(set); QGCCreateTileSetTask* task = new QGCCreateTileSetTask(set);
//-- Create Tile Set (it will also create a list of tiles to download) //-- Create Tile Set (it will also create a list of tiles to download)
......
...@@ -37,10 +37,6 @@ public: ...@@ -37,10 +37,6 @@ public:
}; };
Q_ENUM(ImportAction) Q_ENUM(ImportAction)
Q_PROPERTY(int tileX0 READ tileX0 NOTIFY tileX0Changed)
Q_PROPERTY(int tileX1 READ tileX1 NOTIFY tileX1Changed)
Q_PROPERTY(int tileY0 READ tileY0 NOTIFY tileY0Changed)
Q_PROPERTY(int tileY1 READ tileY1 NOTIFY tileY1Changed)
Q_PROPERTY(quint64 tileCount READ tileCount NOTIFY tileCountChanged) Q_PROPERTY(quint64 tileCount READ tileCount NOTIFY tileCountChanged)
Q_PROPERTY(QString tileCountStr READ tileCountStr NOTIFY tileCountChanged) Q_PROPERTY(QString tileCountStr READ tileCountStr NOTIFY tileCountChanged)
Q_PROPERTY(quint64 tileSize READ tileSize NOTIFY tileSizeChanged) Q_PROPERTY(quint64 tileSize READ tileSize NOTIFY tileSizeChanged)
...@@ -76,13 +72,9 @@ public: ...@@ -76,13 +72,9 @@ public:
Q_INVOKABLE bool importSets (QString path = QString()); Q_INVOKABLE bool importSets (QString path = QString());
Q_INVOKABLE void resetAction (); Q_INVOKABLE void resetAction ();
int tileX0 () { return _totalSet.tileX0; } quint64 tileCount () { return _imageSet.tileCount + _elevationSet.tileCount; }
int tileX1 () { return _totalSet.tileX1; }
int tileY0 () { return _totalSet.tileY0; }
int tileY1 () { return _totalSet.tileY1; }
quint64 tileCount () { return _totalSet.tileCount; }
QString tileCountStr (); QString tileCountStr ();
quint64 tileSize () { return _totalSet.tileSize; } quint64 tileSize () { return _imageSet.tileSize + _elevationSet.tileSize; }
QString tileSizeStr (); QString tileSizeStr ();
QStringList mapList (); QStringList mapList ();
QmlObjectListModel* tileSets () { return &_tileSets; } QmlObjectListModel* tileSets () { return &_tileSets; }
...@@ -108,10 +100,6 @@ public: ...@@ -108,10 +100,6 @@ public:
void setToolbox(QGCToolbox *toolbox); void setToolbox(QGCToolbox *toolbox);
signals: signals:
void tileX0Changed ();
void tileX1Changed ();
void tileY0Changed ();
void tileY1Changed ();
void tileCountChanged (); void tileCountChanged ();
void tileSizeChanged (); void tileSizeChanged ();
void tileSetsChanged (); void tileSetsChanged ();
...@@ -141,7 +129,8 @@ private: ...@@ -141,7 +129,8 @@ private:
void _updateDiskFreeSpace (); void _updateDiskFreeSpace ();
private: private:
QGCTileSet _totalSet; QGCTileSet _imageSet;
QGCTileSet _elevationSet;
double _topleftLat; double _topleftLat;
double _topleftLon; double _topleftLon;
double _bottomRightLat; double _bottomRightLat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment