private:
/**
- * @brief Build URL for donwloading single map tile from OpenStreetMap tile server
- *
- * @param zoomLevel Zoom level
- * @param tileNumbers Tile x & y numbers
- * @return URL for the required tile
- */
- QUrl buildURL(int zoomLevel, QPoint tileNumbers);
-
- /**
* @brief Calculate grid of tile coordinates from current scene coordinate.
*
* Grid size is calculated from view size and scene's current center coordinate.
bool isCenterTileChanged(QPoint sceneCoordinate);
/**
- * @brief Parse given URL to zoom, x and y values. Parsed values are
- * placed in variables given as parameters.
- *
- * @param url url to parse
- * @param [out] zoom zoom variable
- * @param [out] x x variable
- * @param [out] y y variable
- */
- void parseURL(const QUrl &url, int &zoom, int &x, int &y);
-
- /**
* @brief Calculate maximum value for tile in this zoom level.
*
* @param zoomLevel zoom level
/**
* @brief Slot for received map tile images
*
- * Does add MapTile objects to MapScene. Zoom level and location is parsed from URL.
- * @param url URL of the received image
- * @param pixmap Received pixmap
+ * Does add MapTile objects to MapScene.
+ * @param zoomLevel Zoom level
+ * @param x Tile x index
+ * @param y Tile y index
+ * @param image Received pixmap
*/
- void mapImageReceived(const QUrl &url, const QPixmap &pixmap);
+ void mapImageReceived(int zoomLevel, int x, int y, const QPixmap &image);
/**
* @brief Slot for actions after view zoom is finished
/**
* @brief Signal for image fetching.
*
- * @param url image url
+ * @param zoomLevel Zoom level
+ * @param x Tile x index
+ * @param y Tile y index
*/
- void fetchImage(const QUrl &url);
+ void fetchImage(int zoomLevel, int x, int y);
/**
* @brief Signal for view location change
* DATA MEMBERS
******************************************************************************/
private:
- //FriendLocationItem *m_friendLocation; ///< Item to show friends location
+ QPoint m_centerTile; ///< Current center tile
MapFetcher *m_mapFetcher; ///< Fetcher for map tiles
MapScene *m_mapScene; ///< Scene for map tiles
MapZoomPanel *m_mapZoomPanel; ///< Toolbar for zoom buttons
- QPoint m_centerTile; ///< Current center tile
OwnLocationItem *m_ownLocation; ///< Item to show own location
QPoint m_sceneCoordinate; ///< Current center coordinate
QRect m_viewTilesGrid; ///< Current grid of tiles in view (includes margin)