m_tilesGridSize.setWidth(gridWidth);
}
+void MapEngine::showMapArea(const GeoCoordinate &swBound, const GeoCoordinate &neBound)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QRect area;
+ area.setTopRight(SceneCoordinate(neBound).toPointF().toPoint());
+ area.setBottomLeft(SceneCoordinate(swBound).toPointF().toPoint());
+
+ centerAndZoomTo(area, false);
+}
+
+ void MapEngine::updateDirectionIndicator()
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ qreal distance = m_gpsPosition.distanceTo(m_sceneCoordinate);
+
+ qreal direction = m_sceneCoordinate.azimuthTo(SceneCoordinate(m_gpsPosition));
+
+ // direction indicator triangle should be drawn only if the gps location item is not currently
+ // visible on the view
+ bool drawDirectionIndicatorTriangle = true;
+ if (currentViewSceneRect().contains(m_gpsLocationItem->pos()))
+ drawDirectionIndicatorTriangle = false;
+
+ emit directionIndicatorValuesUpdate(direction, distance, drawDirectionIndicatorTriangle);
+ }
+
void MapEngine::updateViewTilesSceneRect()
{
qDebug() << __PRETTY_FUNCTION__;
* as big as possible.
*
* @param rect Target rect
+ * @param useMargins true if margins should be added to rect, false otherwise
*/
- void centerAndZoomTo(QRect rect);
+ void centerAndZoomTo(QRect rect, bool useMargins = true);
/**
+ * @brief Returns the rect of the current scene area drawn on the view
+ *
+ * @returns Rect of the current scene area drawn on the view
+ */
+ QRectF currentViewSceneRect() const;
+
+ /**
* @brief Request disabling of auto centering if centered too far from the real location.
*
* @param coordinate scene's center coordinate
ui/fullscreenbutton.cpp \
ui/imagebutton.cpp \
ui/indicatorbutton.cpp \
+ ui/listitem.cpp \
+ ui/listitemdelegate.cpp \
+ ui/listview.cpp \
+ ui/locationlistitem.cpp \
+ ui/locationlistview.cpp \
+ ui/indicatorbuttonpanel.cpp \
ui/logindialog.cpp \
ui/mainwindow.cpp \
ui/mapscale.cpp \
m_tabbedPanel = new TabbedPanel(this);
m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png"));
m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png"));
+ m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
+ connect(m_tabbedPanel, SIGNAL(panelOpened()),
+ m_friendsListPanel, SLOT(clearFriendListFilter()));
+
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_tabbedPanel, SLOT(resizePanel(QSize)));
}