#include "panelsidebar.h"
MapViewScreen::MapViewScreen(QWidget *parent)
- : QWidget(parent),
- m_autoCenteringEnabled(false)
+ : QWidget(parent)
{
MapView *mapView = new MapView(this);
mapEngine = new MapEngine(this);
connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
mapEngine, SIGNAL(friendsLocationsReady(QList<User*>&)));
- connect(mapEngine, SIGNAL(mapScrolled()), this, SLOT(locationChanged()));
+ connect(mapEngine, SIGNAL(mapScrolledManually()),
+ this, SIGNAL(mapLocationChanged()));
+
+ connect(this, SIGNAL(positionReceived(QPointF,qreal)),
+ mapEngine, SLOT(gpsPositionUpdate(QPointF,qreal)));
+ connect(this, SIGNAL(enableAutoCentering(bool)),
+ mapEngine, SLOT(setAutoCentering(bool)));
QHBoxLayout *mapViewLayout = new QHBoxLayout;
osmLicense->move(width - osmLicense->fontMetrics().width(OSM_LICENSE) - PANEL_PEEK_AMOUNT,
height - osmLicense->fontMetrics().height());
}
-
-void MapViewScreen::locationChanged()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- if (m_autoCenteringEnabled)
- emit mapLocationChanged();
-}
-
-void MapViewScreen::positionReceived(QPointF position, qreal accuracy)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- if (m_autoCenteringEnabled)
- mapEngine->setViewLocation(position);
-}
-
-void MapViewScreen::enableAutoCentering(bool enabled)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_autoCenteringEnabled = enabled;
- mapEngine->setAutoCentering(enabled);
-}