diff options
Diffstat (limited to 'src/mbgl/map/source.hpp')
-rw-r--r-- | src/mbgl/map/source.hpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mbgl/map/source.hpp b/src/mbgl/map/source.hpp index dc939113b2..36613c2052 100644 --- a/src/mbgl/map/source.hpp +++ b/src/mbgl/map/source.hpp @@ -25,11 +25,11 @@ public: public: virtual ~Observer() = default; - virtual void onSourceLoaded() = 0; - virtual void onSourceLoadingFailed(std::exception_ptr error) = 0; + virtual void onSourceLoaded(Source&) {}; + virtual void onSourceError(Source&, std::exception_ptr) {}; - virtual void onTileLoaded(bool isNewTile) = 0; - virtual void onTileLoadingFailed(std::exception_ptr error) = 0; + virtual void onTileLoaded(Source&, const TileID&, bool /* isNewTile */) {}; + virtual void onTileError(Source&, const TileID&, std::exception_ptr) {}; }; Source(); @@ -64,12 +64,6 @@ public: private: void tileLoadingCompleteCallback(const TileID&, const TransformState&, bool collisionDebug); - - void emitSourceLoaded(); - void emitSourceLoadingFailed(const std::string& message); - void emitTileLoaded(bool isNewTile); - void emitTileLoadingFailed(const std::string& message); - bool handlePartialTile(const TileID &id, Worker &worker); bool findLoadedChildren(const TileID& id, int32_t maxCoveringZoom, std::forward_list<TileID>& retain); void findLoadedParent(const TileID& id, int32_t minCoveringZoom, std::forward_list<TileID>& retain); @@ -82,7 +76,6 @@ private: double getZoom(const TransformState &state) const; - // Stores the time when this source was most recently updated. TimePoint updated = TimePoint::min(); @@ -92,7 +85,9 @@ private: TileCache cache; std::unique_ptr<FileRequest> req; - Observer* observer_ = nullptr; + + Observer nullObserver; + Observer* observer = &nullObserver; }; } // namespace mbgl |