From f30765254807bedab0873a289a118906ef74b754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sat, 13 Aug 2016 11:30:15 -0700 Subject: [core] Source-driven attribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723. --- test/src/mbgl/test/stub_style_observer.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/src') diff --git a/test/src/mbgl/test/stub_style_observer.hpp b/test/src/mbgl/test/stub_style_observer.hpp index aa780121f5..7189fd8af4 100644 --- a/test/src/mbgl/test/stub_style_observer.hpp +++ b/test/src/mbgl/test/stub_style_observer.hpp @@ -6,7 +6,7 @@ using namespace mbgl; using namespace mbgl::style; /** - * An implementation of style::Observer that forwards all methods to dynamically-settable lambas. + * An implementation of style::Observer that forwards all methods to dynamically-settable lambdas. */ class StubStyleObserver : public style::Observer { public: @@ -30,6 +30,10 @@ public: if (sourceLoaded) sourceLoaded(source); } + void onSourceAttributionChanged(Source& source, const std::string& attribution) override { + if (sourceAttributionChanged) sourceAttributionChanged(source, attribution); + } + void onSourceError(Source& source, std::exception_ptr error) override { if (sourceError) sourceError(source, error); } @@ -52,6 +56,7 @@ public: std::function spriteLoaded; std::function spriteError; std::function sourceLoaded; + std::function sourceAttributionChanged; std::function sourceError; std::function tileChanged; std::function tileError; -- cgit v1.2.1