void MapEngine::setLocation(QPointF sceneCoordinate)
{
+ /// @todo SAVE LOCATION
emit locationChanged(sceneCoordinate);
+ /// @todo REFACTOR, MAKE NEW METHOD FOR MAP TILE LOGIC
QRect grid = calculateGrid(sceneCoordinate);
int topLeftX = grid.topLeft().x();
int topLeftY = grid.topLeft().y();
}
}
+void MapEngine::zoomIn()
+{
+ if (m_zoomLevel >= MAX_ZOOM_LEVEL)
+ return;
+
+ m_zoomLevel++;
+ emit zoomLevelChanged(m_zoomLevel);
+ /// @todo START FETCHING TILES
+}
+
+void MapEngine::zoomOut()
+{
+ if (m_zoomLevel <= MIN_ZOOM_LEVEL)
+ return;
+
+ m_zoomLevel--;
+ emit zoomLevelChanged(m_zoomLevel);
+ /// @todo START FETCHING TILES
+}
*/
void setLocation(QPointF sceneCoordinate);
+ /**
+ * @brief Slot for zooming in
+ *
+ */
+ void zoomIn();
+
+ /**
+ * @brief Slot for zooming out
+ *
+ */
+ void zoomOut();
+
signals:
/**
* @brief Signal for view location change
mapControlLayout->addWidget(zoomOut);
mapViewLayout->addWidget(mapControl);
connect(search, SIGNAL(clicked()), this, SLOT(searchMap()));
- connect(zoomIn, SIGNAL(clicked()), this, SLOT(zoomInMap()));
- connect(zoomOut, SIGNAL(clicked()), this, SLOT(zoomOutMap()));
+ connect(zoomIn, SIGNAL(clicked()), mapEngine, SLOT(zoomIn()));
+ connect(zoomOut, SIGNAL(clicked()), mapEngine, SLOT(zoomOut()));
//DEBUG
mapViewLayout->addWidget(mapView);
setLayout(mapViewLayout);