mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 11:39:16 +02:00
Yet another TrekBuddy compatability enhancement & fixes
+ related map API refactoring
This commit is contained in:
@ -1750,7 +1750,7 @@ bool GUI::loadMapNode(const TreeNode<Map*> &node, MapAction *&action,
|
||||
|
||||
bool GUI::loadMap(const QString &fileName, MapAction *&action, int &showError)
|
||||
{
|
||||
TreeNode<Map*> maps(MapList::loadMaps(fileName));
|
||||
TreeNode<Map*> maps(MapList::loadMaps(fileName, _mapView->inputProjection()));
|
||||
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
||||
|
||||
return loadMapNode(maps, action, existingActions, showError);
|
||||
@ -1854,7 +1854,7 @@ void GUI::loadMapDir()
|
||||
return;
|
||||
|
||||
QFileInfo fi(dir);
|
||||
TreeNode<Map*> maps(MapList::loadMaps(dir));
|
||||
TreeNode<Map*> maps(MapList::loadMaps(dir, _mapView->inputProjection()));
|
||||
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
||||
QList<MapAction*> actions;
|
||||
QMenu *menu = new QMenu(maps.name());
|
||||
@ -2985,7 +2985,7 @@ void GUI::loadInitialMaps(const QString &selected)
|
||||
if (mapDir.isNull())
|
||||
return;
|
||||
|
||||
TreeNode<Map*> maps(MapList::loadMaps(mapDir));
|
||||
TreeNode<Map*> maps(MapList::loadMaps(mapDir, _mapView->inputProjection()));
|
||||
createMapNodeMenu(createMapActionsNode(maps), _mapMenu, _mapsEnd);
|
||||
|
||||
// Select the active map according to the user settings
|
||||
|
@ -81,15 +81,15 @@ ToolTip MapItem::info() const
|
||||
return tt;
|
||||
}
|
||||
|
||||
MapItem::MapItem(MapAction *action, Map *map, const Projection &proj,
|
||||
GraphicsItem *parent) : PlaneItem(parent)
|
||||
MapItem::MapItem(MapAction *action, Map *map, GraphicsItem *parent)
|
||||
: PlaneItem(parent)
|
||||
{
|
||||
Map *src = action->data().value<Map*>();
|
||||
Q_ASSERT(map->isReady());
|
||||
|
||||
_name = src->name();
|
||||
_fileName = src->path();
|
||||
_bounds = src->llBounds(proj);
|
||||
_bounds = src->llBounds();
|
||||
|
||||
connect(this, &MapItem::triggered, action, &MapAction::trigger);
|
||||
|
||||
|
@ -11,8 +11,7 @@ class MapItem : public QObject, public PlaneItem
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MapItem(MapAction *action, Map *map, const Projection &proj,
|
||||
GraphicsItem *parent = 0);
|
||||
MapItem(MapAction *action, Map *map, GraphicsItem *parent = 0);
|
||||
|
||||
QPainterPath shape() const {return _painterPath;}
|
||||
QRectF boundingRect() const {return _painterPath.boundingRect();}
|
||||
|
@ -250,7 +250,7 @@ void MapView::addWaypoints(const QVector<Waypoint> &waypoints)
|
||||
|
||||
MapItem *MapView::addMap(MapAction *map)
|
||||
{
|
||||
MapItem *mi = new MapItem(map, _map, _inputProjection);
|
||||
MapItem *mi = new MapItem(map, _map);
|
||||
mi->setColor(_palette.nextColor());
|
||||
mi->setWidth(_areaWidth);
|
||||
mi->setPenStyle(_areaStyle);
|
||||
@ -331,7 +331,7 @@ int MapView::fitMapZoom() const
|
||||
RectC br = _tr | _rr | _wr | _ar;
|
||||
|
||||
return _map->zoomFit(viewport()->size() - QSize(2*MARGIN, 2*MARGIN),
|
||||
br.isNull() ? _map->llBounds(_inputProjection) : br);
|
||||
br.isNull() ? _map->llBounds() : br);
|
||||
}
|
||||
|
||||
QPointF MapView::contentCenter() const
|
||||
|
@ -98,6 +98,7 @@ public:
|
||||
void fitContentToSize();
|
||||
|
||||
RectC boundingRect() const;
|
||||
const Projection &inputProjection() const {return _inputProjection;}
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
signals:
|
||||
|
Reference in New Issue
Block a user