1 | #pragma once |
2 | |
3 | #include <mbgl/style/source.hpp> |
4 | |
5 | #include <cstdint> |
6 | #include <exception> |
7 | #include <string> |
8 | |
9 | namespace mbgl { |
10 | |
11 | class MapObserver { |
12 | public: |
13 | virtual ~MapObserver() = default; |
14 | |
15 | static MapObserver& nullObserver() { |
16 | static MapObserver mapObserver; |
17 | return mapObserver; |
18 | } |
19 | |
20 | enum class CameraChangeMode : uint32_t { |
21 | Immediate, |
22 | Animated |
23 | }; |
24 | |
25 | enum class RenderMode : uint32_t { |
26 | Partial, |
27 | Full |
28 | }; |
29 | |
30 | virtual void onCameraWillChange(CameraChangeMode) {} |
31 | virtual void onCameraIsChanging() {} |
32 | virtual void onCameraDidChange(CameraChangeMode) {} |
33 | virtual void onWillStartLoadingMap() {} |
34 | virtual void onDidFinishLoadingMap() {} |
35 | virtual void onDidFailLoadingMap(std::exception_ptr) {} |
36 | virtual void onWillStartRenderingFrame() {} |
37 | virtual void onDidFinishRenderingFrame(RenderMode) {} |
38 | virtual void onWillStartRenderingMap() {} |
39 | virtual void onDidFinishRenderingMap(RenderMode) {} |
40 | virtual void onDidFinishLoadingStyle() {} |
41 | virtual void onSourceChanged(style::Source&) {} |
42 | }; |
43 | |
44 | } // namespace mbgl |
45 | |