Commit 83c609b8 authored by Don Gagne's avatar Don Gagne

Crazy tile counts now handled on Qml side

parent 727c55fe
......@@ -74,20 +74,14 @@ QGCMapEngineManager::updateForCurrentView(double lon0, double lat0, double lon1,
QGCTileSet set = QGCMapEngine::getTileCount(z, lon0, lat0, lon1, lat1, mapType);
_totalSet += set;
}
//-- Beyond 100,000,000 tiles is just nuts
if(_totalSet.tileCount > 100 * 1000 * 1000) {
_crazySize = true;
emit crazySizeChanged();
} else {
_crazySize = false;
emit crazySizeChanged();
emit tileX0Changed();
emit tileX1Changed();
emit tileY0Changed();
emit tileY1Changed();
emit tileCountChanged();
emit tileSizeChanged();
}
emit tileX0Changed();
emit tileX1Changed();
emit tileY0Changed();
emit tileY1Changed();
emit tileCountChanged();
emit tileSizeChanged();
qCDebug(QGCMapEngineManagerLog) << "updateForCurrentView" << lat0 << lon0 << lat1 << lon1 << minZoom << maxZoom;
}
//-----------------------------------------------------------------------------
......
......@@ -37,7 +37,6 @@ public:
Q_PROPERTY(QString tileCountStr READ tileCountStr NOTIFY tileCountChanged)
Q_PROPERTY(quint64 tileSize READ tileSize NOTIFY tileSizeChanged)
Q_PROPERTY(QString tileSizeStr READ tileSizeStr NOTIFY tileSizeChanged)
Q_PROPERTY(bool crazySize READ crazySize NOTIFY crazySizeChanged)
Q_PROPERTY(QmlObjectListModel* tileSets READ tileSets NOTIFY tileSetsChanged)
Q_PROPERTY(QStringList mapList READ mapList CONSTANT)
Q_PROPERTY(QString mapboxToken READ mapboxToken WRITE setMapboxToken NOTIFY mapboxTokenChanged)
......@@ -65,7 +64,6 @@ public:
QString tileCountStr ();
quint64 tileSize () { return _totalSet.tileSize; }
QString tileSizeStr ();
bool crazySize () { return _crazySize; }
QStringList mapList ();
QString mapboxToken ();
QmlObjectListModel* tileSets () { return &_tileSets; }
......@@ -91,7 +89,6 @@ signals:
void tileY1Changed ();
void tileCountChanged ();
void tileSizeChanged ();
void crazySizeChanged ();
void mapboxTokenChanged ();
void tileSetsChanged ();
void maxMemCacheChanged ();
......@@ -114,7 +111,6 @@ private:
private:
QGCTileSet _totalSet;
bool _crazySize;
double _topleftLat;
double _topleftLon;
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