-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapControl.h
More file actions
executable file
·60 lines (49 loc) · 1.53 KB
/
MapControl.h
File metadata and controls
executable file
·60 lines (49 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
// Disable long identifiers warning
#pragma warning(disable : 4786)
#include "Common.h"
#include "Settings.h"
#include "TileCache.h"
class MapControl {
public:
MapControl(HINSTANCE hInstance, HWND hwndMain, TileCache& tileCache);
~MapControl();
LRESULT CALLBACK wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
HWND create(int x, int y, int width, int height);
void requestRedraw();
void setOffset(int offsetX, int offsetY);
void moveToOffset();
void setCenterLonLat(const LonLat* lonLat);
void setZoomLevel(int zoomLevel);
void setZoomLevelKeepingFixPoint(int zoomLevel, int x, int y);
void getSettings(Settings* settings) const;
void setSettings(Settings* settings);
void setStyle(const std::string& styleUrlTemplate);
HINSTANCE m_hInstance;
HWND m_hwndMap;
HWND m_hwndMain;
private:
TileCache& m_tileCache;
void render(HDC hdcDestination, RECT* updateRect);
void setViewportSize(int width, int height);
void getLonLat(int x, int y, LonLat* lonLat) const;
void startDragging(int x, int y);
bool mouseMove(int x, int y);
void endDragging(int x, int y);
void restrictCoordinates(long* x, long* y) const;
void invalidateUpdateRects(const TileKey& tileKey) const;
HBRUSH m_unmappedBrush;
std::string m_styleUrlTemplate;
int m_maxZoomLevel;
int m_zoomLevel;
long m_x;
long m_y;
long m_viewportWidth;
long m_viewportHeight;
int m_offsetX;
int m_offsetY;
bool m_dragging;
int m_dragStartX;
int m_dragStartY;
LonLat m_clickLonLat;
};