[core] Replace MapChange enum with MapObserver
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/map/change.hpp>
|
||||
#include <mbgl/map/map_observer.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -12,7 +12,7 @@ class Context;
|
||||
|
||||
class BackendScope;
|
||||
|
||||
class Backend {
|
||||
class Backend : public MapObserver {
|
||||
public:
|
||||
Backend();
|
||||
virtual ~Backend();
|
||||
@@ -24,9 +24,6 @@ public:
|
||||
// in the near future. (Not called for Map::renderStill() mode.)
|
||||
virtual void invalidate() = 0;
|
||||
|
||||
// Notifies a watcher of map x/y/scale/rotation changes.
|
||||
virtual void notifyMapChange(MapChange change);
|
||||
|
||||
protected:
|
||||
// Called when the backend's GL context needs to be made active or inactive. These are called,
|
||||
// as a matched pair, in four situations:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <mbgl/util/optional.hpp>
|
||||
#include <mbgl/util/chrono.hpp>
|
||||
#include <mbgl/map/map_observer.hpp>
|
||||
#include <mbgl/map/mode.hpp>
|
||||
#include <mbgl/util/geo.hpp>
|
||||
#include <mbgl/util/feature.hpp>
|
||||
|
||||
38
include/mbgl/map/map_observer.hpp
Normal file
38
include/mbgl/map/map_observer.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class MapObserver {
|
||||
public:
|
||||
static MapObserver& nullObserver() {
|
||||
static MapObserver mapObserver;
|
||||
return mapObserver;
|
||||
}
|
||||
|
||||
enum class CameraChangeMode : uint32_t {
|
||||
Immediate,
|
||||
Animated
|
||||
};
|
||||
|
||||
enum class RenderMode : uint32_t {
|
||||
Partial,
|
||||
Full
|
||||
};
|
||||
|
||||
virtual void onCameraWillChange(CameraChangeMode) {}
|
||||
virtual void onCameraIsChanging() {}
|
||||
virtual void onCameraDidChange(CameraChangeMode) {}
|
||||
virtual void onWillStartLoadingMap() {}
|
||||
virtual void onDidFinishLoadingMap() {}
|
||||
virtual void onDidFailLoadingMap() {}
|
||||
virtual void onWillStartRenderingFrame() {}
|
||||
virtual void onDidFinishRenderingFrame(RenderMode) {}
|
||||
virtual void onWillStartRenderingMap() {}
|
||||
virtual void onDidFinishRenderingMap(RenderMode) {}
|
||||
virtual void onDidFinishLoadingStyle() {}
|
||||
virtual void onSourceDidChange() {}
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user