Browse Source

add MapProvider _isElevation attributes

QGC4.4
Pierre TILAK 6 years ago
parent
commit
83d7845e57
  1. 1
      src/QtLocationPlugin/ElevationMapProvider.h
  2. 2
      src/QtLocationPlugin/MapProvider.cpp
  3. 2
      src/QtLocationPlugin/MapProvider.h
  4. 1
      src/QtLocationPlugin/QGCMapEngine.cpp
  5. 2
      src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp

1
src/QtLocationPlugin/ElevationMapProvider.h

@ -21,6 +21,7 @@ class ElevationProvider : public MapProvider { @@ -21,6 +21,7 @@ class ElevationProvider : public MapProvider {
~ElevationProvider();
bool _isElevationProvider(){return true;}
protected:
// Define the url to Request

2
src/QtLocationPlugin/MapProvider.cpp

@ -73,3 +73,5 @@ int MapProvider::lat2tileY(double lat, int z) { @@ -73,3 +73,5 @@ int MapProvider::lat2tileY(double lat, int z) {
log(tan(lat * M_PI / 180.0) + 1.0 / cos(lat * M_PI / 180.0)) / M_PI) /
2.0 * pow(2.0, z)));
}
bool MapProvider::_isElevationProvider(){return false;}

2
src/QtLocationPlugin/MapProvider.h

@ -33,6 +33,8 @@ class MapProvider : public QObject { @@ -33,6 +33,8 @@ class MapProvider : public QObject {
virtual int lat2tileY(double lat, int z);
virtual bool _isElevationProvider();
protected:
QString _tileXYToQuadKey(int tileX, int tileY, int levelOfDetail);
int _getServerNum(int x, int y, int max);

1
src/QtLocationPlugin/QGCMapEngine.cpp

@ -264,7 +264,6 @@ QGCMapEngine::getTileCount(int zoom, double topleftLon, double topleftLat, doubl @@ -264,7 +264,6 @@ QGCMapEngine::getTileCount(int zoom, double topleftLon, double topleftLat, doubl
}
set.tileCount = (static_cast<quint64>(set.tileX1) - static_cast<quint64>(set.tileX0) + 1) * (static_cast<quint64>(set.tileY1) - static_cast<quint64>(set.tileY0) + 1);
qDebug() << "getTileCount : " << set.tileCount;
set.tileSize = getQGCMapEngine()->urlFactory()->averageSizeForType(mapType) * set.tileCount;
return set;
}

2
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp

@ -106,8 +106,10 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian @@ -106,8 +106,10 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
while(i.hasNext()){
i.next();
if(!i.value()->_isElevationProvider()){
mapList.append(QGCGEOMAPTYPE(i.value()->getMapStyle(), i.key(), i.key(), false, false, getQGCMapEngine()->urlFactory()->getIdFromType(i.key()) ));
}
}
setSupportedMapTypes(mapList);
//-- Users (QML code) can define a different user agent

Loading…
Cancel
Save