mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 03:29:16 +02:00
Added DEM data overview
This commit is contained in:
@ -384,6 +384,9 @@ void GUI::createActions()
|
||||
_downloadDEMAction->setEnabled(false);
|
||||
_downloadDEMAction->setShortcut(DOWNLOAD_DEM_SHORTCUT);
|
||||
connect(_downloadDEMAction, &QAction::triggered, this, &GUI::downloadDEM);
|
||||
_showDEMTilesAction = new QAction(tr("Show local DEM tiles"));
|
||||
_showDEMTilesAction->setMenuRole(QAction::NoRole);
|
||||
connect(_showDEMTilesAction, &QAction::triggered, this, &GUI::showDEMTiles);
|
||||
|
||||
// Graph actions
|
||||
_showGraphsAction = new QAction(QIcon(SHOW_GRAPHS_ICON), tr("Show graphs"),
|
||||
@ -595,7 +598,7 @@ void GUI::createMenus()
|
||||
_poiMenu->addAction(_showPOIAction);
|
||||
|
||||
QMenu *demMenu = menuBar()->addMenu(tr("DEM"));
|
||||
demMenu->addSeparator();
|
||||
demMenu->addAction(_showDEMTilesAction);
|
||||
demMenu->addAction(_downloadDEMAction);
|
||||
|
||||
QMenu *settingsMenu = menuBar()->addMenu(tr("&Settings"));
|
||||
@ -1730,6 +1733,14 @@ void GUI::demLoaded()
|
||||
reloadFiles();
|
||||
}
|
||||
|
||||
void GUI::showDEMTiles()
|
||||
{
|
||||
_mapView->loadDEMs(DEM::tiles());
|
||||
|
||||
_fileActionGroup->setEnabled(true);
|
||||
_reloadFileAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void GUI::updateStatusBarInfo()
|
||||
{
|
||||
if (_files.count() == 0)
|
||||
|
@ -76,6 +76,7 @@ private slots:
|
||||
void openOptions();
|
||||
void clearMapCache();
|
||||
void downloadDEM();
|
||||
void showDEMTiles();
|
||||
|
||||
void mapChanged(QAction *action);
|
||||
void graphChanged(int);
|
||||
@ -234,6 +235,7 @@ private:
|
||||
QAction *_showCoordinatesAction;
|
||||
QAction *_openOptionsAction;
|
||||
QAction *_downloadDEMAction;
|
||||
QAction *_showDEMTilesAction;
|
||||
QAction *_mapsEnd;
|
||||
QAction *_poisEnd;
|
||||
|
||||
|
@ -293,6 +293,23 @@ void MapView::loadMaps(const QList<MapAction *> &maps)
|
||||
centerOn(contentCenter());
|
||||
}
|
||||
|
||||
void MapView::loadDEMs(const QList<Area> &dems)
|
||||
{
|
||||
int zoom = _map->zoom();
|
||||
|
||||
for (int i = 0; i < dems.size(); i++)
|
||||
addArea(dems.at(i));
|
||||
|
||||
if (fitMapZoom() != zoom)
|
||||
rescale();
|
||||
else
|
||||
updatePOIVisibility();
|
||||
|
||||
updateZValues(_areas);
|
||||
|
||||
centerOn(contentCenter());
|
||||
}
|
||||
|
||||
int MapView::fitMapZoom() const
|
||||
{
|
||||
RectC br = _tr | _rr | _wr | _ar;
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
|
||||
QList<PathItem *> loadData(const Data &data);
|
||||
void loadMaps(const QList<MapAction*> &maps);
|
||||
void loadDEMs(const QList<Area> &dems);
|
||||
|
||||
void setPalette(const Palette &palette);
|
||||
void setPOI(POI *poi);
|
||||
|
Reference in New Issue
Block a user